.visionneuse {
  --encre: #142b2b;
  --fond: #faf9f3;
  --filet: #d8dcd1;
  --secondaire: #526562;
  background: var(--fond);
  color: var(--encre);
}
#livre { height: 100vh; height: 100dvh; min-height: 280px; display: flex; flex-direction: column; }
.visionneuse button { background: transparent; border: 0; padding: 0; }
.visionneuse :is(button,a,select,input):focus-visible { outline: 3px solid #e77927; outline-offset: -2px; }
.lecture-entete { flex: none; min-height: 4.55rem; padding: .55rem clamp(.9rem,2.6vw,3.2rem); background: #0b1922; color: #f4f6ed; display: flex; align-items: center; gap: clamp(.8rem,2.15vw,2.5rem); }
.lecture-entete .brand { font-size: .92rem; gap: .5rem; }
.lecture-entete .marque { width: 2rem; height: 2rem; }
.entete-trait { width: 1px; height: 2.2rem; background: #48575a; }
.titre-edition { flex: 1; min-width: 0; }
.titre-edition p, .surtitre { font-size: .76rem; letter-spacing: .085em; font-weight: 690; }
.titre-edition p { color: #c9eb9a; }
.titre-edition h1 { font-size: clamp(1.05rem,1.9vw,1.5rem); font-weight: 670; letter-spacing: -.025em; line-height: 1.12; margin-top: .2rem; }
.sortie { display: inline-flex; align-items: center; gap: .35rem; color: #edf3e7; text-decoration: none; padding: .25rem .7rem .25rem .45rem; min-height: 44px; font-size: .93rem; }
.sortie:hover, .telecharger:hover, .original:hover { text-decoration: underline; }
.plan-lecture { flex: 1; min-height: 0; display: flex; position: relative; isolation: isolate; }
#panneau { display: flex; flex-direction: column; width: clamp(15.5rem,22vw,21rem); flex: none; min-height: 0; background: #f4f5ed; border-right: 1px solid var(--filet); z-index: 3; }
.titre-sommaire { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem .8rem 1rem 1.35rem; border-bottom: 1px solid var(--filet); }
.surtitre { color: var(--secondaire); font-size: .74rem; }
.titre-sommaire h2 { font-size: clamp(1.6rem,2.05vw,2rem); letter-spacing: -.04em; margin-top: .25rem; }
.sommaire-liste { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #99a9a2 transparent; padding: .35rem .55rem .7rem; }
.sommaire-liste ol { list-style: none; padding: 0; margin: 0; }
.sommaire-liste li { position: relative; border-bottom: 1px solid var(--filet); }
.repere { display: flex; gap: .55rem; align-items: baseline; justify-content: space-between; padding: .68rem .68rem; text-decoration: none; line-height: 1.33; min-height: 44px; border-left: 3px solid transparent; font-size: .94rem; }
.repere small { font-variant-numeric: tabular-nums; color: var(--secondaire); font-size: .82rem; }
.repere:hover { background: #e6eadf; }
.repere[aria-current="location"] { background: #e0edbc; border-color: #51743c; color: #1c3822; font-weight: 670; }
.sommaire-liste li:has(details) > .repere { margin-right: 2.3rem; }
.sous-rubriques summary { position: absolute; right: 0; top: 0; width: 2.35rem; height: 44px; display: grid; place-items: center; list-style: none; color: var(--secondaire); }
.sous-rubriques summary::-webkit-details-marker { display: none; }
.sous-rubriques summary svg { width: .9rem; }
.sous-rubriques[open] summary svg { transform: rotate(90deg); }
.sous-rubriques .repere { margin-left: .85rem; font-size: .88rem; border-left-color: #c4cdbf; }
.telecharger { display: flex; align-items: center; gap: .65rem; flex: none; min-height: 3.45rem; padding: .5rem 1.35rem; border-top: 1px solid var(--filet); text-decoration: none; font-size: .91rem; font-weight: 610; }
.espace-lecture { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; position: relative; }
.outils, .pied-lecture { flex: none; background: var(--fond); display: flex; gap: .8rem; align-items: center; padding: .36rem clamp(.65rem,2vw,2rem); }
.outils { min-height: 3.4rem; border-bottom: 1px solid #bfcac3; }
.outils button, .bouton-icone, .original, .choix-vue { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; font-size: .92rem; }
#sommaire { font-weight: 650; }
.visionneuse .bouton-icone { min-width: 42px; min-height: 44px; }
.visionneuse button:hover:not(:disabled), .choix-vue:hover { background-color: #e7ebe0; border-radius: .32rem; }
.choix-vue { position: relative; margin-left: auto; gap: .22rem; }
.choix-vue select { padding: .25rem .1rem; min-height: 44px; max-width: 100%; color: var(--encre); border: 0; background: transparent; font-size: .91rem; }
.zoom { display: flex; align-items: center; padding-left: .45rem; border-left: 1px solid var(--filet); }
.zoom #ajuster { min-width: 3.15rem; font-variant-numeric: tabular-nums; }
.table-lecture { flex: 1; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; background-color: #536866; background-image: radial-gradient(ellipse at 50% 28%,#829391 0,#627977 52%,#485e5d 100%); -webkit-overflow-scrolling: touch; }
.table-lecture:focus-visible { outline: 3px solid #d3fc6b; outline-offset: -4px; }
.centrage { width: max-content; min-width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: var(--marge,22px); }
.livre-ouvert { position: relative; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.feuille { flex: none; background: white; position: relative; color: #161c1b; box-shadow: 1px 2px 2px #2c3b38, 3px 4px 0 -1px #d3d1c8, 4px 5px 0 -1px #8e9a90, 0 12px 30px #13292268; }
.feuille canvas { display: block; width: 100%; height: 100%; }
.double .feuille + .feuille { margin-left: 1px; }
.double .feuille::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to left,#21332c20,transparent 2.7%); }
.double .feuille:nth-child(2)::after { background: linear-gradient(to right,#21332c22,transparent 2.9%); }
.feuille[aria-busy="true"]::before { content: 'Chargement…'; position: absolute; top: 48%; left: 0; width: 100%; color: #526562; font-size: .9rem; text-align: center; }
.feuille-tournee { position: absolute; z-index: 5; top: 50%; transform-origin: left center; backface-visibility: hidden; pointer-events: none; }
.feuille-tournee.retour { transform-origin: right center; }
.table-lecture.texte { background: #dce4dc; }
.texte .centrage { width: 100%; align-items: flex-start; }
.feuille-texte { background: #fffef9; max-width: 48rem; width: 100%; min-height: 12rem; padding: clamp(1rem,3.6vw,3.25rem); box-shadow: 0 3px 18px #293d3728; color: #1b2a2b; }
.texte .livre-ouvert { display: block; width: 100%; max-width: 48rem; }
.feuille-texte h2 { font-size: 1rem; margin-bottom: 1.1em; color: #49615a; }
.feuille-texte p { margin: .7em 0; font-size: var(--texte-taille,1.1rem); line-height: 1.64; overflow-wrap: anywhere; }
.erreur { position: absolute; bottom: 4.3rem; left: 50%; transform: translateX(-50%); width: min(88%,34rem); padding: .7rem 1rem; border-radius: .3rem; color: #142b2b; background: #fff9da; box-shadow: 0 3px 15px #15211d50; z-index: 4; font-size: .93rem; }
.pied-lecture { position: relative; min-height: 3.8rem; display: grid; grid-template-columns: 1fr auto 1fr; padding-block: .35rem; border-top: 1px solid #d0d7ce; }
.progression { position: absolute; top: -3px; left: 0; right: 0; height: 3px; background: #344c4b; }
.progression i { display: block; height: 100%; width: 0; background: #ccf27b; }
.progression-texte, .original, .pagination, #saut { display: flex; align-items: center; gap: .5rem; }
.progression-texte, .original { font-size: .86rem; color: #465c56; }
.pastille { width: .5rem; height: .5rem; border-radius: 50%; border: 1.5px solid #597460; }
.original { justify-self: end; text-decoration: none; }
.pagination { justify-self: center; gap: .6rem; }
.visionneuse .fleche { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #cad4c8; border-radius: 50%; }
.visionneuse .fleche:last-child { background: #18463c; color: white; border-color: #18463c; }
.visionneuse .fleche:last-child:hover:not(:disabled) { background: #285d4e; border-radius: 50%; }
#saut { font-size: .93rem; gap: .33rem; white-space: nowrap; }
#numero { width: 3.1rem; min-height: 36px; padding: .15rem; border: 1px solid #a6b4a9; border-radius: .25rem; background: white; text-align: center; color: var(--encre); appearance: textfield; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
#numero::-webkit-inner-spin-button { -webkit-appearance: none; }
.visionneuse .valider { min-height: 44px; min-width: 2rem; color: #305845; font-weight: 650; }
.voile { position: absolute; inset: 0; z-index: 2; background: #0b1e2499!important; border-radius: 0!important; }
@media(max-width:930px){.progression-texte { display: none; }.pied-lecture { grid-template-columns: 1fr auto 1fr; }.pagination { grid-column: 2; }}
@media(max-width:760px){
  .lecture-entete { min-height: 3.9rem; gap: .75rem; }
  .lecture-entete .brand span,.entete-trait,.sortie span { display: none; }
  .lecture-entete .brand { min-width: 32px; }
  .sortie { width: 44px; border: 1px solid #47605b; border-radius: 50%; justify-content: center; padding: 0; }
  #panneau { position: absolute; top: 0; bottom: 0; left: 0; width: min(88%,21rem); box-shadow: 9px 0 30px #13252050; }
  .centrage { --marge: 12px; }
  .outils { gap: .3rem; padding: .18rem .55rem; }
  .outils .ic { width: 1.1rem; }
  .outils #sommaire { gap: .3rem; }
  .zoom { padding: 0; }
  .zoom #ajuster { min-width: 2.85rem; }
  .visionneuse .zoom .bouton-icone { min-width: 34px; }
  .titre-edition p { font-size: .71rem; }
  .pied-lecture { min-height: 3.45rem; }
  .original { width: 40px; }
  .original span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
}
@media(max-width:400px){.choix-vue .ic { display:none; }.outils { gap:.2rem; padding-inline:.35rem; }.outils select,.outils button { font-size:.86rem; }.visionneuse .zoom .bouton-icone { min-width:30px; }.pagination { gap:.3rem; }.original {width:30px;}}
@media(max-height:480px){.lecture-entete { min-height:2.75rem; padding-block:.13rem; }.titre-edition p {display:none;}.outils,.pied-lecture {min-height:2.5rem;padding-block:0;}.visionneuse #livre {min-height:210px;}}
@media(prefers-reduced-motion:reduce){.feuille-tournee{display:none!important;}}

@media (pointer:fine){.feuille { cursor: grab; }.table-lecture.saisie,.saisie .feuille{ cursor: grabbing; }}
.table-lecture:not(.texte) { touch-action: pan-y; }
.table-lecture.agrandie:not(.texte) { touch-action: pan-x pan-y; }
