/* Académie : le livre de leçons qu'on ouvre (préfixe lv-). Maquette : 4.ANDROID/ARCANESCOOKIE/CLAUDE/MAQUETTES_REFONTE/09_academie_livre_ouvert.html.
   Couleurs : jetons « objets » du thème (--paper, --paper-shade, --ink, --gilt, --wax), avec un repli calculé pour les thèmes qui ne les ont pas.
   --cuir = couleur du livre (val_livres.cuir). */
.lv-page {
    --lv-papier: var(--paper, color-mix(in srgb, var(--accent) 12%, light-dark(var(--bg), var(--text))));
    --lv-ombre-papier: var(--paper-shade, color-mix(in srgb, var(--lv-papier) 78%, var(--accent)));
    --lv-encre: var(--ink, light-dark(var(--text), var(--bg)));
    --lv-or: var(--gilt, color-mix(in srgb, var(--accent) 40%, var(--lv-papier)));
    --lv-cire: var(--wax, var(--err));
    --lv-titre: color-mix(in srgb, var(--lv-encre) 55%, #8a2a10);
    --lv-doux: color-mix(in srgb, var(--lv-encre) 55%, var(--lv-papier));
    --lv-filet: color-mix(in srgb, var(--lv-encre) 30%, var(--lv-papier));
    --lv-filet-clair: color-mix(in srgb, var(--lv-encre) 14%, var(--lv-papier));
    --lv-orne: color-mix(in srgb, var(--lv-or) 55%, var(--lv-encre));
    --lv-vert: color-mix(in srgb, var(--ok) 55%, var(--lv-encre));
    max-width: 1240px;
}
.lv-page .crumbs { margin-bottom: .6rem; }

/* ---------- Sans JavaScript : le livre se lit comme une longue page ---------- */
.lv-source { max-width: 820px; margin: 0 auto; display: grid; gap: 1.2rem; }
.lv-src-tete, .lv-src-som, .lv-src-lecon { padding: clamp(1rem, 4vw, 2rem); color: var(--lv-encre); background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--lv-papier) 70%, #fff), var(--lv-papier) 65%, var(--lv-ombre-papier)); border-radius: 6px 14px 14px 6px; box-shadow: 0 18px 30px -16px rgb(0 0 0 / .7); }
.lv-src-tete { text-align: center; }
.lv-src-tete h1, .lv-src-som h2, .lv-src-chap h2 { color: var(--lv-titre); }
.lv-src-som a { color: var(--lv-encre); }
.lv-src-som .lue a { color: var(--lv-doux); }
.lv-src-chap { text-align: center; }
.lv-src-fin { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem; }
.lv-texte .val-callout, .lv-texte blockquote { background: color-mix(in srgb, var(--lv-encre) 6%, transparent); }
.lv-verrou { text-align: center; font-weight: 700; }
.lv-js .lv-source { display: none; }

/* ---------- La scène ---------- */
.lv-scene { position: relative; display: grid; justify-items: center; padding: 18px 0 8px; overflow: hidden; }
.lv-livre { --pw: 400px; --ph: 580px; position: relative; width: calc(var(--pw) * 2); height: var(--ph); margin: 14px 0; perspective: 2600px; transition: transform .9s cubic-bezier(.3,.7,.2,1); }
.lv-livre.simple { width: var(--pw); }
.lv-livre.ferme { transform: translateX(calc(var(--pw) * -.5)); }
.lv-livre.simple.ferme { transform: none; }
.lv-livre.arrive { animation: lv-arrive .7s cubic-bezier(.2,.8,.2,1) both; }
.lv-livre.simple.arrive { animation-name: lv-arrive-s; }
@keyframes lv-arrive { from { opacity: 0; transform: translateX(calc(var(--pw) * -.5)) translateY(40px) scale(.6) rotate(-4deg); } }
@keyframes lv-arrive-s { from { opacity: 0; transform: translateY(40px) scale(.6) rotate(-4deg); } }
.lv-livre.sans-anim, .lv-livre.sans-anim * { transition: none !important; animation: none !important; }

.lv-reliure { position: absolute; inset: -12px; border-radius: 8px; transition: opacity .3s;
    background: radial-gradient(ellipse at 30% 20%, #fff1, transparent 60%), linear-gradient(90deg, #0006, transparent 6%, transparent 94%, #0006), var(--cuir);
    box-shadow: 0 30px 50px -18px #000, inset 0 0 0 2px color-mix(in srgb, var(--lv-or) 30%, transparent); }
.lv-reliure::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 10px); width: 20px; background: linear-gradient(90deg, transparent, #0007 45%, #0007 55%, transparent); }
.simple .lv-reliure::after { left: 0; width: 14px; background: linear-gradient(90deg, #0009, transparent); }
.ferme .lv-reliure { opacity: 0; }
.lv-tranche { position: absolute; top: 3px; bottom: 3px; background: repeating-linear-gradient(90deg, var(--lv-papier) 0 1px, var(--lv-ombre-papier) 1px 2px); box-shadow: 0 0 2px #0006; transition: width .3s; }
.lv-tranche--g { right: 100%; width: var(--eg, 4px); border-radius: 3px 0 0 3px; }
.lv-tranche--d { left: 100%; width: var(--ed, 4px); border-radius: 0 3px 3px 0; }
.ferme .lv-tranche--g { opacity: 0; }
.lv-slot { position: absolute; top: 0; width: var(--pw); height: var(--ph); }
.lv-slot--g { left: 0; } .lv-slot--d { left: var(--pw); }
.simple .lv-slot--d { display: none; }
.ferme .lv-slot--g { visibility: hidden; }

/* ---------- Une feuille ---------- */
.lv-feuille { position: absolute; inset: 0; overflow: hidden; color: var(--lv-encre); font-family: var(--font-body), serif; font-size: 14.5px; line-height: 1.62; text-align: left;
    background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--lv-papier) 72%, #fff) 0%, var(--lv-papier) 62%, var(--lv-ombre-papier) 130%); }
.lv-feuille::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.lv-feuille.gauche { border-radius: 6px 0 0 6px; box-shadow: inset -26px 0 30px -22px color-mix(in srgb, var(--lv-encre) 60%, transparent); }
.lv-feuille.droite { border-radius: 0 6px 6px 0; box-shadow: inset 26px 0 30px -22px color-mix(in srgb, var(--lv-encre) 60%, transparent); }
.simple .lv-feuille { border-radius: 0 6px 6px 0; box-shadow: inset 20px 0 24px -20px color-mix(in srgb, var(--lv-encre) 60%, transparent); }
.lv-feuille__tete { position: absolute; top: 18px; left: 34px; right: 34px; font-family: var(--font-h2), serif; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--lv-doux); border-bottom: 1px solid color-mix(in srgb, var(--lv-filet) 55%, transparent); padding-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-feuille.droite .lv-feuille__tete { text-align: right; }
.simple .lv-feuille__tete { text-align: center; }
.lv-feuille__corps { position: absolute; top: 46px; left: 34px; right: 34px; bottom: 44px; overflow: hidden; }
.lv-feuille__folio { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-family: var(--font-h1), serif; font-size: 13px; color: var(--lv-doux); }
.lv-feuille__coin { position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; border-radius: 0 0 6px 0; opacity: 0; transition: opacity .2s; background: linear-gradient(135deg, transparent 50%, color-mix(in srgb, var(--lv-ombre-papier) 70%, var(--lv-papier)) 50%, var(--lv-ombre-papier)); }
@media (hover: hover) { .lv-feuille.droite:hover .lv-feuille__coin { opacity: 1; } }
.lv-feuille.gauche .lv-feuille__coin { display: none; }

/* Texte des leçons sur le papier */
.lv-feuille__corps > :first-child { margin-top: 0; }
.lv-feuille h2, .lv-feuille h3, .lv-feuille h4 { font-family: var(--font-h1), serif; font-weight: 400; color: var(--lv-titre); line-height: 1.2; margin: 1em 0 .4em; }
.lv-feuille h2 { font-size: 1.32em; } .lv-feuille h3 { font-size: 1.12em; } .lv-feuille h4 { font-size: 1em; }
.lv-feuille p { margin: 0 0 .65em; }
.lv-feuille strong { color: color-mix(in srgb, var(--lv-encre) 85%, #000); }
.lv-feuille a { color: var(--lv-titre); }
.lv-feuille ul, .lv-feuille ol { padding-left: 1.3em; margin: 0 0 .7em; }
.lv-feuille li { margin-bottom: .25em; }
.lv-feuille table { width: 100%; border-collapse: collapse; margin: .4em 0 .9em; font-size: .93em; }
.lv-feuille th { text-align: left; font-family: var(--font-h2), serif; font-weight: 400; font-size: .78em; letter-spacing: .06em; color: var(--lv-titre); background: none; border: 0; border-bottom: 1.5px solid var(--lv-filet); padding: .3em .45em; }
.lv-feuille td { border: 0; border-bottom: 1px solid var(--lv-filet-clair); padding: .3em .45em; }
.lv-feuille td:first-child strong { color: var(--lv-titre); }
.lv-feuille .val-table-wrap { margin: 0; overflow-x: auto; }
.lv-feuille .val-callout { margin: .6em 0 .9em; padding: .55em .8em; border-left: 3px solid var(--lv-orne); background: color-mix(in srgb, var(--lv-encre) 6%, transparent); border-radius: 6px; }
.lv-feuille .val-callout--tip { border-left-color: var(--lv-vert); }
.lv-feuille .val-callout--warning { border-left-color: var(--lv-cire); }
.lv-feuille .val-callout-title { font-family: var(--font-h2), serif; font-size: .8em; letter-spacing: .08em; color: var(--lv-titre); margin-bottom: .2em; font-weight: 400; }
.lv-feuille .val-callout > :last-child, .lv-feuille .val-callout ul { margin-bottom: 0; }
.lv-feuille blockquote { margin: .6em 0; padding: .4em .8em; border-left: 3px solid var(--lv-titre); font-style: italic; background: color-mix(in srgb, var(--lv-encre) 5%, transparent); color: var(--lv-encre); box-shadow: none; border-radius: 0 6px 6px 0; }
.lv-feuille details { margin: .3em 0 .5em; border: 1px solid var(--lv-filet); border-radius: 6px; padding: .15em .6em; background: color-mix(in srgb, var(--lv-papier) 70%, #fff); color: var(--lv-encre); }
.lv-feuille summary { color: var(--lv-titre); font-size: .92em; padding: .3em 0; }
.lv-feuille summary::after { color: var(--lv-titre); }
.lv-cul { text-align: center; margin-top: 45%; color: var(--lv-orne); font-size: 22px; }
.lv-orne { color: var(--lv-orne); letter-spacing: .5em; font-size: 12px; }

/* Début d'une leçon */
.lv-chap { text-align: center; margin: 4px 0 14px; }
.lv-chap__num { font-family: var(--font-h2), serif; font-size: 11px; letter-spacing: .25em; color: var(--lv-doux); text-transform: uppercase; }
.lv-chap__titre { font-family: var(--font-h1), serif; font-size: 1.75em; color: var(--lv-titre); line-height: 1.1; margin: 4px 0 6px; }
.lv-chap__resume { font-style: italic; font-size: .92em; color: color-mix(in srgb, var(--lv-encre) 80%, var(--lv-papier)); margin: 0 0 8px; }
.lv-etat { display: inline-block; margin-top: 6px; font: 700 11px var(--font-ui, system-ui), sans-serif; padding: 2px 10px; border-radius: 8px; border: 1px solid var(--lv-filet); color: var(--lv-doux); }
.lv-etat.lue { border-color: var(--lv-vert); color: var(--lv-vert); }
.lv-etat.ici { border-color: var(--lv-cire); color: var(--lv-cire); }

/* Fin d'une leçon : sceau de cire + série d'exercices */
.lv-fin { text-align: center; margin: 1.1em 0 .4em; padding-top: .4em; }
.lv-fin__orne { color: var(--lv-orne); font-size: 18px; }
.lv-fin__txt { font-family: var(--font-h1), serif; color: var(--lv-titre); margin: 0 0 10px; }
.lv-fin__btns { display: grid; gap: 8px; justify-items: center; }
.lv-sceau { position: relative; border: 0; cursor: pointer; padding: .55em 1.3em .55em 3.2em; border-radius: 8px; font: 700 13px var(--font-ui, system-ui), sans-serif; color: #fbeedd;
    background: linear-gradient(180deg, color-mix(in srgb, var(--lv-cire) 80%, #fff), var(--lv-cire)); box-shadow: 0 3px 0 color-mix(in srgb, var(--lv-cire) 55%, #000), 0 6px 14px -6px #000; }
.lv-sceau::before { content: "✦"; position: absolute; left: 6px; top: 50%; width: 30px; height: 30px; margin-top: -15px; display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--lv-cire) 65%, #fff), var(--lv-cire) 60%, color-mix(in srgb, var(--lv-cire) 55%, #000)); box-shadow: inset 0 0 0 2px #0002; }
.lv-sceau:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--lv-cire) 55%, #000); }
.lv-sceau:disabled { opacity: .6; cursor: wait; }
.lv-entrainer { display: inline-block; border: 1.5px solid var(--lv-titre); background: transparent; color: var(--lv-titre) !important; border-radius: 8px; padding: .45em 1.2em; font: 700 13px var(--font-ui, system-ui), sans-serif; text-decoration: none !important; }
.lv-entrainer:hover { background: color-mix(in srgb, var(--lv-titre) 8%, transparent); }
.lv-tampon { display: inline-block; font: 700 13px var(--font-ui, system-ui), sans-serif; color: var(--lv-vert); border: 2px solid var(--lv-vert); border-radius: 8px; padding: .3em .9em; transform: rotate(-4deg); }
.lv-tampon.frappe { animation: lv-frappe .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes lv-frappe { from { transform: rotate(-4deg) scale(2.2); opacity: 0; } }

/* Garde, titre, sommaire, chemin */
.lv-garde { position: absolute; inset: 0; display: grid; place-items: center; background:
    radial-gradient(circle, color-mix(in srgb, var(--lv-or) 70%, transparent) 0 1.3px, transparent 1.8px) 0 0 / 22px 22px,
    radial-gradient(circle, color-mix(in srgb, var(--lv-or) 35%, transparent) 0 1px, transparent 1.5px) 11px 11px / 22px 22px,
    repeating-linear-gradient(45deg, transparent 0 15px, color-mix(in srgb, var(--lv-or) 10%, transparent) 15px 16px),
    repeating-linear-gradient(-45deg, transparent 0 15px, color-mix(in srgb, var(--lv-or) 10%, transparent) 15px 16px),
    radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--cuir) 80%, #fff), color-mix(in srgb, var(--cuir) 75%, #000)); }
.lv-exlibris { width: 62%; padding: 18px 16px; text-align: center; background: var(--lv-papier); color: var(--lv-encre); border: 1px solid var(--lv-filet); outline: 3px double var(--lv-filet); outline-offset: -8px; box-shadow: 0 8px 18px -8px #000a; font-family: var(--font-h1), serif; }
.lv-exlibris small { display: block; font-family: var(--font-h2), serif; font-size: 10px; letter-spacing: .2em; color: var(--lv-doux); text-transform: uppercase; overflow-wrap: anywhere; }
.lv-exlibris b { display: block; font-weight: 400; font-size: 22px; color: var(--lv-titre); margin: 6px 0; }
/* Garde en image (admin, SQL 061) : l'étiquette est dans l'image, vierge ; l'ex-libris est écrit dedans, sans cadre.
   Image 2:3 posée en « cover » : l'étiquette (49 % de la largeur, 16 % de la hauteur de l'image) reste au centre. */
.lv-garde--image { background: var(--garde) center / cover no-repeat, var(--cuir); container-type: size; }
.lv-garde--image .lv-exlibris { width: min(46cqw, 30cqh); max-height: min(15cqh, 22cqw); padding: 0; background: none; border: 0; outline: 0; box-shadow: none;
    display: flex; flex-direction: column; justify-content: center; overflow: hidden; color: #3a2a1a; }
.lv-garde--image .lv-exlibris small { font-size: clamp(6px, min(1.35cqh, 2cqw), 10px); letter-spacing: .12em; color: #6b5a45; }
.lv-garde--image .lv-exlibris b { font-size: clamp(10px, min(2.5cqh, 3.7cqw), 18px); margin: .25em 0; color: #5a2418; overflow-wrap: anywhere; line-height: 1.1; }
.lv-titre { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.lv-titre small { font-family: var(--font-h2), serif; font-size: 11px; letter-spacing: .3em; color: var(--lv-doux); text-transform: uppercase; }
.lv-titre h1 { font-family: var(--font-h2), serif; font-weight: 400; font-size: clamp(24px, 7vw, 34px); letter-spacing: .06em; color: var(--lv-titre); margin: 8px 0 0; overflow-wrap: anywhere; }
.lv-titre .lv-orne { margin: 14px 0; }
.lv-titre__num { font-family: var(--font-h1), serif; font-size: 20px; color: var(--lv-titre); }
.lv-titre__pour { font-style: italic; color: color-mix(in srgb, var(--lv-encre) 80%, var(--lv-papier)); }
.lv-titre__bas { margin-top: 40px; font-family: var(--font-h2), serif; font-size: 10px; letter-spacing: .25em; color: var(--lv-doux); text-transform: uppercase; }
.lv-som-titre { text-align: center; letter-spacing: .12em; font-family: var(--font-h2), serif !important; font-size: 20px !important; margin: 4px 0 16px !important; }
.lv-som { list-style: none; margin: 0; padding: 0 0 0 16px !important; }
.lv-som li { margin: 0; }
.lv-som a { position: relative; display: flex; align-items: baseline; gap: 6px; padding: 5px 4px; color: var(--lv-encre) !important; text-decoration: none; border-radius: 4px; }
.lv-som a:hover { background: color-mix(in srgb, var(--lv-titre) 8%, transparent); }
.lv-som .n { flex: none; width: 1.6em; font-family: var(--font-h1), serif; color: var(--lv-doux); }
.lv-som .t { flex: 0 1 auto; min-width: 0; }
.lv-som .pts { flex: 1 1 12px; border-bottom: 1.5px dotted color-mix(in srgb, var(--lv-doux) 60%, transparent); transform: translateY(-4px); min-width: 12px; }
.lv-som .p { flex: none; font-family: var(--font-h1), serif; color: var(--lv-titre); min-width: 1.6em; text-align: right; }
.lv-som .lue .n::before { content: "✔"; color: var(--lv-vert); }
.lv-som .lue .n span { display: none; }
.lv-som .lue .t { color: color-mix(in srgb, var(--lv-encre) 75%, var(--lv-papier)); }
.lv-som .ici { background: color-mix(in srgb, var(--lv-cire) 9%, transparent); }
.lv-som .ici .t { color: var(--lv-cire); font-weight: 700; }
.lv-som .ici::before { content: ""; position: absolute; left: -15px; top: -2px; width: 10px; height: 30px; background: var(--lv-cire); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }
.lv-legende { margin-top: 14px; font-size: 12px; color: var(--lv-doux); text-align: center; font-style: italic; }
.lv-chemin { text-align: center; }
.lv-chemin h2 { text-align: center; }
.lv-anneau { width: 130px; height: 130px; margin: 6px auto 10px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lv-titre) calc(var(--p) * 1%), color-mix(in srgb, var(--lv-filet) 35%, transparent) 0); }
.lv-anneau i { width: 104px; height: 104px; border-radius: 50%; background: var(--lv-papier); display: grid; place-items: center; align-content: center; font: 400 26px var(--font-h1), serif; color: var(--lv-titre); font-style: normal; line-height: 1.1; }
.lv-anneau i small { display: block; font: 700 9px var(--font-ui, system-ui), sans-serif; color: var(--lv-doux); letter-spacing: .1em; text-transform: uppercase; }
.lv-prochaine { margin: 10px 0 10px; font-style: italic; color: color-mix(in srgb, var(--lv-encre) 80%, var(--lv-papier)); }

/* ---------- Couverture ---------- */
.lv-couv { position: absolute; top: -12px; left: var(--pw); width: calc(var(--pw) + 12px); height: calc(var(--ph) + 24px); transform-origin: left center; transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.45,.05,.2,1); z-index: 20; cursor: pointer; }
.simple .lv-couv { left: 0; }
.lv-couv__face, .lv-couv__dos { position: absolute; inset: 0; border-radius: 4px 10px 10px 4px; backface-visibility: hidden; }
.lv-couv__face { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--lv-or); padding: 30px;
    background: radial-gradient(ellipse at 35% 25%, #ffffff22, transparent 55%), linear-gradient(90deg, #0008 0, #0003 4%, transparent 9%), var(--cuir); box-shadow: 0 30px 50px -18px #000, inset 0 0 0 1px #0006; }
.lv-couv__cadre { position: absolute; inset: 22px 22px 22px 34px; border: 2px solid color-mix(in srgb, var(--lv-or) 75%, transparent); outline: 1px solid color-mix(in srgb, var(--lv-or) 50%, transparent); outline-offset: -8px; border-radius: 4px; pointer-events: none; }
.lv-couv__cadre::before, .lv-couv__cadre::after { content: "❦"; position: absolute; left: 50%; transform: translateX(-50%); font-size: 20px; color: var(--lv-or); background: var(--cuir); padding: 0 8px; }
.lv-couv__cadre::before { top: -14px; } .lv-couv__cadre::after { bottom: -14px; transform: translateX(-50%) rotate(180deg); }
.lv-couv small { font-family: var(--font-h2), serif; font-size: 11px; letter-spacing: .3em; opacity: .85; text-transform: uppercase; }
.lv-couv h2 { font-family: var(--font-h2), serif; font-weight: 400; font-size: clamp(24px, 7vw, 34px); letter-spacing: .06em; margin: 14px 0 4px; text-shadow: 0 2px 0 #0007; color: var(--lv-or); overflow-wrap: anywhere; }
.lv-couv__num { font-family: var(--font-h1), serif; font-size: 22px; }
.lv-couv__pour { font-family: var(--font-body), serif; font-style: italic; font-size: 14px; opacity: .85; margin-top: 18px; }
.lv-couv__medaillon { width: 86px; height: 86px; margin: 22px auto 0; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--lv-or); font: 400 30px var(--font-h2), serif;
    box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--cuir) 70%, #000), inset 0 0 0 6px color-mix(in srgb, var(--lv-or) 60%, transparent); }
.lv-couv__ouvrir { margin-top: 26px; font: 700 12px var(--font-ui, system-ui), sans-serif; letter-spacing: .08em; padding: .5em 1.2em; border-radius: 8px; border: 1px solid var(--lv-or); background: #0003; color: var(--lv-or); animation: lv-souffle 2.4s ease-in-out infinite; }
@keyframes lv-souffle { 50% { box-shadow: 0 0 18px 2px color-mix(in srgb, var(--lv-or) 45%, transparent); } }
/* 1re de couverture en image (admin, SQL 061) : le titre est dans l'image, seul le bouton « Ouvrir » se pose dessus */
.lv-couv__face--image { background: var(--couv) center / contain no-repeat, var(--cuir);   /* image entière : le titre va presque d un bord à l autre */ justify-content: flex-end; padding-bottom: 9%; }
.lv-couv__dos { transform: rotateY(180deg); border-radius: 10px 4px 4px 10px; overflow: hidden; }
.lv-couv__dos .lv-garde { border-radius: inherit; box-shadow: inset 0 0 0 10px var(--cuir); }
.lv-couv__tranche { position: absolute; top: 4px; bottom: 4px; right: -6px; width: 8px; border-radius: 0 3px 3px 0; background: repeating-linear-gradient(90deg, var(--lv-papier) 0 1px, var(--lv-ombre-papier) 1px 2px); transform: translateZ(-1px); }
/* 4e de couverture (2026-11-15) : le livre fermé se retourne ; vu de dos, tranches des pages à gauche et dos du livre à droite */
.lv-quat { position: absolute; top: -12px; left: var(--pw); width: calc(var(--pw) + 12px); height: calc(var(--ph) + 24px); z-index: 21; border-radius: 10px 4px 4px 10px; cursor: pointer;
    background: var(--quat) center / cover no-repeat, var(--cuir); box-shadow: inset -7px 0 12px -5px #0009, 0 24px 34px -14px #000;
    visibility: hidden; }
.simple .lv-quat { left: 0; }
.lv-quat__tranche { position: absolute; top: 4px; bottom: 4px; left: -6px; width: 8px; border-radius: 3px 0 0 3px; background: repeating-linear-gradient(90deg, var(--lv-papier) 0 1px, var(--lv-ombre-papier) 1px 2px); }
.lv-quat__txt { position: absolute; inset: 20% 12% 14%; padding: 14px 10px; border-radius: 16px; background: radial-gradient(ellipse at 50% 30%, #000a, transparent 72%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--lv-or); }
.lv-quat__txt small { font: 400 11px var(--font-h2), serif; letter-spacing: .25em; text-transform: uppercase; opacity: .9; }
.lv-quat__txt b { font: 400 clamp(22px, 5vw, 30px) var(--font-h2), serif; text-shadow: 0 2px 0 #0007; overflow-wrap: anywhere; }
.lv-quat__txt em { font: italic 15px/1.55 var(--font-body), serif; color: color-mix(in srgb, var(--lv-or) 55%, #fff); }
.lv-quat__filet { width: 60%; height: 1px; background: color-mix(in srgb, var(--lv-or) 60%, transparent); }
.lv-quat__info { font: 700 12px var(--font-ui, system-ui), sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.lv-quat__barre { width: 70%; height: 6px; border-radius: 2px; background: #0006; overflow: hidden; }
.lv-quat__barre i { display: block; height: 100%; border-radius: 2px; background: var(--lv-or); }
.lv-quat .lv-couv__ouvrir { margin-top: auto; }
.lv-quat:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
/* Retourner = le livre fermé tourne d'un bloc (demande de Cookie) : il se resserre, change de face au milieu, se rouvre ;
   pendant ce temps et vu de dos, rien du livre ouvert en dessous (pages, tranches, reliure) ne se voit. */
.lv-livre.retourne .lv-couv { visibility: hidden; }
.lv-livre.retourne .lv-quat { visibility: visible; }
.lv-livre.tourne > :not(.lv-couv):not(.lv-quat), .lv-livre.retourne > :not(.lv-couv):not(.lv-quat) { visibility: hidden; }
.lv-livre.tourne .lv-couv, .lv-livre.tourne .lv-quat { transform-origin: center; animation: lv-tourne .6s ease-in-out; }
@keyframes lv-tourne { 50% { transform: scaleX(0); } }
.lv-retourner { display: flex; justify-content: center; margin-top: 14px; }
.lv-retourner button { min-height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--border); background: var(--plate, #171029); color: var(--text); font: 700 13px var(--font-ui, system-ui), sans-serif; cursor: pointer; }
.lv-retourner button:hover { border-color: var(--accent); }
.lv-scene.ouvert .lv-retourner { display: none; }
.lv-couv:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 10px; }
.lv-livre.ouvert .lv-couv { transform: rotateY(-180deg); }
.lv-livre.simple.ouvert .lv-couv { opacity: 0; transition: transform 1.2s cubic-bezier(.45,.05,.2,1), opacity .4s .8s; }
.lv-livre.ouvert.pose .lv-couv { visibility: hidden; }

/* ---------- Ruban ---------- */
.lv-signet { position: absolute; top: -12px; width: 14px; height: calc(var(--ph) + 46px); z-index: 15; pointer-events: none; padding: 0; border: 0; background: none; }
.lv-signet i { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 9px), 0 100%); box-shadow: 0 2px 4px #0006;
    background: linear-gradient(90deg, color-mix(in srgb, var(--lv-cire) 70%, #000), var(--lv-cire) 40%, color-mix(in srgb, var(--lv-cire) 75%, #fff) 55%, var(--lv-cire) 70%, color-mix(in srgb, var(--lv-cire) 70%, #000)); }
.lv-signet.queue { height: 46px; top: calc(var(--ph) - 2px); pointer-events: auto; cursor: pointer; }
.lv-signet.queue::after { content: attr(data-n); position: absolute; top: 50px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 10px var(--font-ui, system-ui), sans-serif; color: var(--text-dim); }
.lv-signet[hidden], .lv-livre:not(.pose) .lv-signet { display: none; }

/* ---------- Feuillet qui tourne ---------- */
.lv-feuillet { position: absolute; top: 0; width: var(--pw); height: var(--ph); transform-style: preserve-3d; z-index: 10; }
.lv-face { position: absolute; inset: 0; backface-visibility: hidden; }
.lv-face--dos { transform: rotateY(180deg); }
.lv-ombre { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--d) ease-in-out; }
.lv-face--avant .lv-ombre { background: linear-gradient(90deg, transparent 40%, #0005); }
.lv-face--dos .lv-ombre { background: linear-gradient(270deg, transparent 40%, #0005); }
.lv-feuillet.tourne .lv-ombre { opacity: 1; }
.lv-feuillet.tourne-fin .lv-ombre { opacity: 0; }

/* ---------- Commandes ---------- */
.lv-commandes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 62px; }
.lv-scene:not(.ouvert) .lv-commandes { visibility: hidden; }
.lv-commandes button { min-height: 42px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 14px; font: 700 13px var(--font-ui, system-ui), sans-serif; cursor: pointer; }
.lv-commandes button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.lv-commandes button:disabled { opacity: .35; cursor: default; }
.lv-commandes button[hidden] { display: none; }
.lv-fleche { width: 46px; padding: 0 !important; font-size: 18px !important; }
.lv-btn-signet { border-color: color-mix(in srgb, var(--lv-cire) 60%, var(--border)) !important; }
.lv-folio { min-width: 120px; text-align: center; color: var(--text-dim); font: 12px var(--font-ui, system-ui), sans-serif; padding: .2rem .6rem; background: var(--plate); border-radius: 8px; }
.lv-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; padding: .7em 1.2em; border-radius: 8px; background: var(--surface-2, var(--surface)); border: 1px solid var(--accent); color: var(--text); font: 14px var(--font-ui, system-ui), sans-serif; transition: .3s; z-index: 60; max-width: 90vw; text-align: center; }
.lv-toast.on { opacity: 1; transform: translateX(-50%); }
.lv-mesure { position: absolute; left: 0; top: 0; width: var(--pw); height: var(--ph); visibility: hidden; pointer-events: none; }
@media (max-width: 480px) { .lv-commandes { gap: 6px; } .lv-commandes button { padding: 0 11px; } .lv-folio { order: -1; width: 100%; background: none; } }
@media (prefers-reduced-motion: reduce) { .lv-livre, .lv-couv, .lv-quat, .lv-couv__ouvrir { transition: none !important; animation: none !important; } }

/* ---------- Grimoire de grammaire (mode « grammaire », 2026-11-15) ---------- */
.lv-regle { margin: 0 0 1.1em; }
.lv-regle h3 { margin: .2em 0 .35em; }
.lv-ex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: .4em 0 0 !important; padding: 7px 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--lv-filet) 70%, transparent); background: color-mix(in srgb, var(--lv-encre) 5%, transparent); }
.lv-ex b { font-family: var(--font-h1), serif; font-weight: 400; font-size: 1.2em; color: var(--lv-titre); }
.lv-ex__trad { font-weight: 700; color: var(--lv-vert); }
.lv-briser { display: none; }
/* Dans le livre : la traduction est scellée tant qu'on n'a pas brisé le sceau */
.lv-feuille .lv-ex:not(.is-revele) .lv-ex__trad { flex: 1 1 80px; min-width: 60px; color: transparent; user-select: none; border-radius: 4px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--lv-doux) 30%, transparent) 0 8px, color-mix(in srgb, var(--lv-doux) 14%, transparent) 8px 12px); }
.lv-feuille .lv-ex:not(.is-revele) .lv-briser { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-left: auto; padding: 0 14px 0 4px; border: 0; border-radius: 8px; cursor: pointer;
    font: 700 12px var(--font-ui, system-ui), sans-serif; color: #fbeedd; background: linear-gradient(180deg, color-mix(in srgb, var(--lv-cire) 80%, #fff), var(--lv-cire)); box-shadow: 0 3px 0 color-mix(in srgb, var(--lv-cire) 55%, #000); }
.lv-feuille .lv-ex:not(.is-revele) .lv-briser::before { content: "✦"; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--lv-cire) 65%, #fff), var(--lv-cire) 60%, color-mix(in srgb, var(--lv-cire) 55%, #000)); }
.lv-feuille .lv-ex:not(.is-revele) .lv-briser:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--lv-cire) 55%, #000); }
.lv-feuille .lv-ex.is-revele .lv-ex__trad { animation: lv-revele .45s ease; }
@keyframes lv-revele { from { opacity: 0; filter: blur(4px); } }
.lv-recherche { position: relative; width: min(520px, 100%); margin: 14px auto 0; }
.lv-recherche label { display: grid; gap: 6px; font: 700 12px var(--font-ui, system-ui), sans-serif; color: var(--text-dim); }
.lv-recherche input { font: 15px var(--font-body), serif; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.lv-recherche__res { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.lv-recherche__res:empty { display: none; }
.lv-recherche__res button { width: 100%; min-height: 44px; display: grid; gap: 2px; text-align: left; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: 14px var(--font-body), serif; }
.lv-recherche__res button:hover, .lv-recherche__res button:focus-visible { border-color: var(--accent); }
.lv-recherche__res small { color: var(--text-dim); font-size: 12px; }
.lv-recherche__vide { padding: 8px 12px; color: var(--text-dim); font-style: italic; }
.lv-page--grammaire .lv-src-lecon .lv-ex__trad::before { content: "→ "; }

/* ---------- Dictionnaire du Lexique (mode « lexique », maquette A du 2026-11-15) ---------- */
.lx-mots { display: grid; gap: 2px; }
.lx-e { display: block; width: 100%; padding: 3px 6px; margin: 0 0 1px; border: 0; border-radius: 6px; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; font-size: .9em; line-height: 1.38; }
.lx-e:hover, .lx-e:focus-visible { background: color-mix(in srgb, var(--lv-cire) 10%, transparent); outline: 1.5px solid color-mix(in srgb, var(--lv-cire) 40%, transparent); }
.lx-e b { font-family: var(--font-h1), serif; font-weight: 400; font-size: 1.22em; color: var(--lv-titre); }
.lx-e__pron { color: var(--lv-doux); font-size: .85em; }
.lx-e__type { font: 700 .66em var(--font-ui, system-ui), sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--lv-doux); }
.lx-e__trad { display: block; }
.lx-e__trad span { color: var(--lv-doux); }
.lx-lettrine { font-family: var(--font-h1), serif; font-size: 3.6em; line-height: 1; color: var(--lv-cire); }
.lv-page--lexique .lv-chap { display: flex; align-items: center; gap: 12px; text-align: left; margin: 0 0 8px; border-bottom: 1px solid var(--lv-filet); }
.lv-page--lexique .lv-chap .lv-etat { margin: 0; }
.lv-page--lexique .lv-src-lecon .lx-e { padding: 6px 4px; border-bottom: 1px dotted var(--lv-filet); border-radius: 0; }
/* Onglets A–Z taillés dans la tranche (grand écran) ou en bandeau au-dessus du livre (téléphone) */
.lx-onglets { display: flex; flex-wrap: wrap; gap: 3px; margin: 8px 0; }
.lx-onglets a, .lx-onglets span { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px; font: 400 15px var(--font-h1), serif; text-decoration: none; color: var(--lv-titre); background: var(--lv-papier); box-shadow: 1px 1px 0 #0004; }
.lx-onglets span { opacity: .35; }
.lx-onglets a[aria-current] { color: #fbeedd; background: var(--lv-cire); }
.lx-onglets a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lv-js .lx-onglets:not(.lx-onglets--haut) { position: absolute; z-index: 6; top: 18px; bottom: 18px; right: -12px; margin: 0; flex-direction: column; flex-wrap: nowrap; gap: 1px; }
.lv-js .lx-onglets:not(.lx-onglets--haut) a, .lv-js .lx-onglets:not(.lx-onglets--haut) span { flex: 1 1 0; min-height: 0; height: auto; max-height: 28px; min-width: 0; width: 30px; border-radius: 0 6px 6px 0; font-size: 12px; box-shadow: 2px 1px 0 #0005; }
.lv-js .lx-onglets:not(.lx-onglets--haut) a:not([aria-current]) { width: 26px; margin-left: 4px; }
.lv-livre:not(.pose) .lx-onglets { opacity: 0; pointer-events: none; }
.lx-onglets--haut { flex-wrap: nowrap; overflow-x: auto; width: 100%; max-width: 100%; padding: 2px 2px 6px; scrollbar-width: thin; }
.lx-onglets--haut a, .lx-onglets--haut span { flex: 0 0 auto; min-width: 36px; height: 40px; }
/* Fiche d'un mot : un feuillet de parchment, le favori est un sceau de cire */
.lx-fiche { color: var(--lv-encre); background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--lv-papier) 70%, #fff), var(--lv-papier) 70%, var(--lv-ombre-papier)); border: 1px solid var(--lv-filet); }
.lx-fiche h2 { font-family: var(--font-h1), serif; font-weight: 400; color: var(--lv-titre); }
.lx-fiche .hint, .lx-fiche .mot-trad small { color: var(--lv-doux); }
.lx-fiche .mot-trad { background: color-mix(in srgb, var(--lv-encre) 6%, transparent); border: 1px solid var(--lv-filet); }
.lx-fiche .mot-note { border-left: 3px solid var(--lv-cire); padding: .5rem .8rem; background: color-mix(in srgb, var(--lv-cire) 7%, transparent); }
.lx-fiche .badge { color: var(--lv-encre); background: color-mix(in srgb, var(--lv-encre) 8%, transparent); border-color: var(--lv-filet); }
.lx-fiche .dialog__foot { border-color: var(--lv-filet); }
.lx-fiche .mot-x { color: var(--lv-encre); }
.lx-sceau { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; padding: 0 16px 0 5px; border-radius: 8px; cursor: pointer; font: 700 13px var(--font-ui, system-ui), sans-serif;
    color: var(--lv-cire); background: none; border: 1.5px dashed color-mix(in srgb, var(--lv-cire) 70%, transparent); }
.lx-sceau i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; font-style: normal; border: 1.5px dashed currentColor; }
.lx-sceau.on { color: #fbeedd; border-style: solid; border-color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--lv-cire) 80%, #fff), var(--lv-cire)); box-shadow: 0 3px 0 color-mix(in srgb, var(--lv-cire) 55%, #000); }
.lx-sceau.on i { border: 0; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--lv-cire) 65%, #fff), var(--lv-cire) 60%, color-mix(in srgb, var(--lv-cire) 55%, #000)); }
.lx-sceau:active { transform: translateY(2px); }
.lx-fiche .kicker, .lx-fiche .mot-formes h3 { color: var(--lv-titre); }
.lx-lettrine--mot { font-size: 1.9em; }

/* Tableaux larges (5 colonnes ou plus, ex. Fêtes des terres, zodiaque) sur téléphone : une fiche par ligne (2026-11-16, comme l'appli).
   1re colonne en petite étiquette, 2e en titre, colonnes du milieu sur une ligne, dernière en texte. */
@media (max-width: 560px) {
    .lv table:has(tr > :nth-child(5)), .alm table:has(tr > :nth-child(5)), .prose table:has(tr > :nth-child(5)) { display: block; width: 100%; border: 0; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) :is(thead, tbody) { display: block; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 8px; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) :is(td, th) { display: inline; padding: 0; border: 0; background: none; text-align: left; font-weight: inherit; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) th { text-transform: none; letter-spacing: normal; font: inherit; color: inherit; }   /* une ligne de données écrite en <th> (Fêtes des terres) reste une fiche comme les autres */
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr > :first-child { flex: 1 1 100%; font: 700 .7rem var(--font-ui, system-ui), sans-serif; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr > :nth-child(2) { flex: 1 1 100%; font-size: 1.05em; font-weight: 700; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr > :not(:first-child):not(:nth-child(2)):not(:last-child) { font-size: .85em; opacity: .85; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr > :not(:first-child):not(:nth-child(2)):not(:last-child)::after { content: " ·"; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr > :nth-last-child(2)::after { content: none; }
    :is(.lv, .alm, .prose) table:has(tr > :nth-child(5)) tr > :last-child { flex: 1 1 100%; margin-top: 4px; }
}
