/* Bible du Soldat — 503e RT · livre à pages tournantes
   ---------------------------------------------------------------------------
   Charte du site ET-R : marine #1F3864, bande #2F5496, vert #1F5C3A, sable #B49B6C.
   Le texte des pages est en Arial (police du site) ; les titres du livre en Georgia,
   police système présente sur Windows, macOS et iOS (repli serif ailleurs), sans
   chargement externe. Aucune dépendance : le feuilletage est en CSS 3D + JavaScript.
   Contrastes : texte #1C1C1C sur papier #FDFBF6 (16:1) ; sable réservé aux filets.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: only light;
  --navy: #1F3864;
  --band: #2F5496;
  --vert: #1F5C3A;
  --sable: #B49B6C;
  --sable-clair: #E3D6BC;
  --gris: #6B6B6B;
  --focus: #F2D69B;          /* contour de focus sur le marine (8,9:1) */
  --papier: #FDFBF6;
  --papier-ombre: #EFE9DC;
  --encre: #1C1C1C;
  --font: Arial, Helvetica, sans-serif;
  --titre: Georgia, "Times New Roman", "Liberation Serif", serif;
  --fs: 15px;                /* taille de base du texte des pages, fixée par bible.js */
  --duree: .85s;             /* durée d'un tournage de page */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--font);
  color: #fff;
  background: var(--navy);
  background-image: radial-gradient(circle at 50% 35%, #2F5496 0%, #1F3864 55%, #16294a 100%);
  overflow: hidden;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- application : entête (bandeau commun), scène, pied ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ===== BANDEAU COMMUN (début) =====
   Bloc identique au caractère près dans planning/assets/app.css, service/assets/app.css et
   bible/bible.css : toute retouche se reporte dans les trois (contrôle : deploy/verif-bandeau.ps1).
   Modèle : l'entête de la Bible du Soldat. Balisage : header.bandeau > a.bandeau-marque
   (img.bandeau-insigne, span.bandeau-txt > span.bandeau-unite + span.bandeau-titre), puis
   nav.bandeau-menu > .bandeau-btn (liens ou boutons) et span.bandeau-qui (personne connectée).
   Couleurs écrites en dur : le jeton --focus n'a pas la même valeur d'une feuille à l'autre.
   Titre dans la police des boutons (Arial, héritée du bandeau) : demande de David, lot 1.0927.02 ;
   Georgia reste réservée aux pages du livre.
   Contrastes sur le dégradé #24427a → #1F3864 : blanc 9,8 à 11,6:1 ; sable clair #E3D6BC 6,8 à 8,1:1 ;
   contour de focus #F2D69B 7,0 à 8,2:1 ; libellé d'un bouton sur son fond 7,9:1.
   position + z-index : l'ombre passe au-dessus du contenu qui suit, même s'il a un fond (tableau). */
.bandeau { flex: none; position: relative; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  min-height: 54px; padding: 8px 14px; color: #fff; font: 15px/1.2 Arial, Helvetica, sans-serif;
  background: #1F3864 linear-gradient(180deg, #24427a, #1F3864); border-bottom: 2px solid #1F5C3A; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.bandeau-marque { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; border-radius: 4px; }
.bandeau-insigne { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.bandeau-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.bandeau-unite { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #E3D6BC; }
.bandeau-unite sup { text-transform: none; font-size: .75em; line-height: 0; letter-spacing: 0; }
.bandeau-titre { font-size: 19px; white-space: nowrap; }
.bandeau-marque:hover .bandeau-titre, .bandeau-marque:focus-visible .bandeau-titre { text-decoration: underline; }
.bandeau-menu { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bandeau-btn { font: inherit; color: #fff; text-decoration: none; cursor: pointer; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28); border-radius: 6px; padding: 6px 12px; }
.bandeau-btn:hover { background: rgba(255,255,255,.18); }
.bandeau-qui { font-size: 13px; color: #E3D6BC; padding: 0 4px; }
.bandeau :focus-visible { outline: 3px solid #F2D69B; outline-offset: 2px; }
@media (max-width: 700px) {
  .bandeau { min-height: 48px; padding: 6px 10px; }
  .bandeau-insigne { width: 32px; height: 32px; }
  .bandeau-unite, .bandeau-qui { display: none; }
  .bandeau-titre { font-size: 17px; }
  .bandeau-btn { padding: 6px 8px; font-size: 13px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .bandeau { min-height: 42px; padding: 4px 10px; }
  .bandeau-titre { font-size: 16px; }
}
@media print { .bandeau { display: none !important; } }
/* ===== BANDEAU COMMUN (fin) ===== */

.barre { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.btn-nav {
  font: inherit; color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.28); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; line-height: 1.2;
}
.btn-nav:hover { background: rgba(255,255,255,.18); }
.btn-nav:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-nav { padding: 6px 10px; display: inline-flex; align-items: center; }
.btn-nav svg { fill: #fff; }
.btn-nav[disabled] { opacity: .35; cursor: default; }
.btn-nav[disabled]:hover { background: rgba(255,255,255,.08); }

.barre.bas {
  justify-content: center; gap: 12px;
  background: linear-gradient(0deg, #16294a, #1F3864);
  border-top: 1px solid rgba(180,155,108,.45);
  min-height: 54px;
}
.chapitres select {
  font: inherit; font-size: 14px; color: #fff; background: #24427a;
  border: 1px solid rgba(255,255,255,.28); border-radius: 6px; padding: 6px 8px; max-width: 46vw;
}
.chapitres select option { color: #111; background: #fff; }
.indicateur { font-size: 13px; color: var(--sable-clair); min-width: 96px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- scène et livre ---------- */
.scene {
  flex: 1 1 auto; min-height: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px;
  perspective: 2600px; perspective-origin: 50% 50%;
  touch-action: pan-y;             /* le balayage horizontal tourne les pages */
  -webkit-user-select: none; user-select: none;
}
.scene.pret { -webkit-user-select: text; user-select: text; }
.chargement { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: var(--sable-clair); font-size: 15px; }
.livre {
  position: relative; transform-style: preserve-3d;
  filter: drop-shadow(0 22px 28px rgba(0,0,0,.45));
  visibility: hidden;
}
.livre.pret { visibility: visible; }
.slot { position: absolute; top: 0; height: 100%; width: 50%; }
.slot.gauche { left: 0; }
.slot.droite { left: 50%; }
.livre.simple .slot { width: 100%; }
.livre.simple .slot.gauche { display: none; }
.livre.simple .slot.droite { left: 0; }
/* tranche des pages : quelques filets clairs sous les pages, comme l'épaisseur d'un livre */
.livre::before, .livre::after {
  content: ""; position: absolute; top: 3px; bottom: -4px; width: 7px; z-index: 0;
  background: repeating-linear-gradient(90deg, #f6f1e6 0 1px, #d9d0bd 1px 2px);
  border-radius: 0 3px 3px 0;
}
.livre::after { right: -6px; }
.livre::before { left: -6px; transform: scaleX(-1); }
.livre.simple::before, .livre.ferme::before { display: none; }
.livre.ferme::after { display: none; }

/* la feuille qui tourne : recto à droite, verso au dos, pivot sur la reliure */
.feuille {
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform var(--duree) cubic-bezier(.36,.02,.28,1);
  z-index: 6; pointer-events: none; display: none;
}
.livre.simple .feuille { left: 0; width: 100%; }
.feuille.active { display: block; }
.feuille .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.feuille .verso { transform: rotateY(180deg); }
.feuille.tourne { transform: rotateY(-180deg); }
.feuille.retour { transform: rotateY(0deg); }
/* ombre portée de la feuille en mouvement et assombrissement de sa face qui s'incline */
.feuille .face::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, rgba(0,0,0,.28), rgba(0,0,0,0) 45%);
  opacity: 0; transition: opacity calc(var(--duree) * .9) ease;
}
.feuille .verso::before { background: linear-gradient(270deg, rgba(0,0,0,.28), rgba(0,0,0,0) 45%); }
.feuille.tourne .recto::before, .feuille.retour .verso::before { opacity: 1; }
.feuille.tourne .verso::before, .feuille.retour .recto::before { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .feuille { transition: none; }
  .feuille .face::before { transition: none; }
}

/* ---------- la page ---------- */
.page {
  position: absolute; inset: 0;
  background: var(--papier); color: var(--encre);
  font-size: var(--fs); line-height: 1.42;
  display: flex; flex-direction: column;
  padding: calc(var(--fs) * 1.6) calc(var(--fs) * 2.2) calc(var(--fs) * 1.2);
  overflow: hidden;
  border-radius: 2px;
}
/* ombre de reliure : plus marquée côté pli */
.slot.gauche .page::after, .feuille .verso .page::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 9%; pointer-events: none;
  background: linear-gradient(270deg, rgba(0,0,0,.16), rgba(0,0,0,.04) 40%, rgba(0,0,0,0));
}
.slot.droite .page::after, .feuille .recto .page::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 9%; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.16), rgba(0,0,0,.04) 40%, rgba(0,0,0,0));
}
.livre.simple .slot.droite .page::after, .livre.simple .feuille .page::after { width: 5%; }
.page-tete {
  flex: none; display: flex; justify-content: space-between; align-items: baseline;
  font-size: calc(var(--fs) * .72); letter-spacing: .1em; text-transform: uppercase; color: var(--gris);
  border-bottom: 1px solid var(--sable); padding-bottom: calc(var(--fs) * .35); margin-bottom: calc(var(--fs) * .9);
  white-space: nowrap; overflow: hidden;
}
.page-tete .chap { overflow: hidden; text-overflow: ellipsis; }
.page-corps { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.page-pied {
  flex: none; display: flex; justify-content: space-between; align-items: baseline;
  font-size: calc(var(--fs) * .72); color: var(--gris); margin-top: calc(var(--fs) * .8);
  padding-top: calc(var(--fs) * .3); min-height: calc(var(--fs) * 1.7);
}
.page-pied .num { font-family: var(--titre); font-size: calc(var(--fs) * .95); color: var(--navy); min-width: 1em; }
.page-pied .livre-nom { letter-spacing: .08em; text-transform: uppercase; font-size: calc(var(--fs) * .66); }
/* 503e dans une ligne en capitales (pied de page, page de garde, quatrième de couverture) : e en exposant, petit et en minuscule */
.page-pied .livre-nom sup, .garde-sous sup, .couv-unite sup { text-transform: none; font-size: .62em; line-height: 0; vertical-align: super; letter-spacing: 0; }
.page.gauche .page-pied { flex-direction: row; }
.page.droite .page-pied { flex-direction: row-reverse; }
.page.droite .page-tete { flex-direction: row-reverse; }
/* coin corné : indique que la page se tourne au clic sur son bord */
.page .coin {
  position: absolute; bottom: 0; width: calc(var(--fs) * 2.2); height: calc(var(--fs) * 2.2);
  cursor: pointer; opacity: .55; transition: opacity .2s;
}
.page.droite .coin { right: 0; background: linear-gradient(225deg, var(--papier-ombre) 0 50%, transparent 50%); border-radius: 0 0 2px 0; }
.page.gauche .coin { left: 0; background: linear-gradient(135deg, var(--papier-ombre) 0 50%, transparent 50%); }
.page:hover .coin { opacity: 1; }

/* ----- typographie du contenu ----- */
.page-corps > * { margin: 0 0 calc(var(--fs) * .75); }
.page-corps > :last-child { margin-bottom: 0; }
.page-corps p { text-align: left; hyphens: auto; -webkit-hyphens: auto; }
.page-corps sup { font-size: .7em; line-height: 0; }
.page-corps a { color: var(--band); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.page-corps small { font-size: .85em; color: var(--gris); }
.page-corps strong { color: var(--navy); }
.page-corps em { font-style: italic; }
.page-corps .note { font-size: .86em; color: var(--gris); font-style: italic; }
.chap-tete { margin: 0 0 calc(var(--fs) * 1.1); padding-bottom: calc(var(--fs) * .8); border-bottom: 2px solid var(--vert); position: relative; }
.chap-num { font-family: var(--titre); font-size: calc(var(--fs) * .8); letter-spacing: .22em; text-transform: uppercase; color: var(--sable); margin-bottom: calc(var(--fs) * .3); }
.chap-num::before { content: ""; display: inline-block; width: 2.2em; height: 1px; background: var(--sable); vertical-align: middle; margin-right: .6em; }
.page-corps h2 { font-family: var(--titre); font-weight: normal; font-size: calc(var(--fs) * 1.95); line-height: 1.1; color: var(--navy); margin: 0; letter-spacing: -.005em; }
.page-corps h3 { font-family: var(--titre); font-weight: normal; font-size: calc(var(--fs) * 1.28); line-height: 1.2; color: var(--vert); margin: calc(var(--fs) * 1.1) 0 calc(var(--fs) * .45); }
.page-corps h3:first-child { margin-top: 0; }
.page-corps .chapeau { font-size: calc(var(--fs) * 1.04); color: #2d3340; line-height: 1.45; }
/* illustrations (photographies du régiment) : en tête de chapitre, sous le chapeau */
.page-corps .illus { margin: calc(var(--fs) * .5) 0 calc(var(--fs) * .7); }
.page-corps .illus img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.18); background: #E6E1D3; }
.page-corps .illus figcaption { font-size: calc(var(--fs) * .78); font-style: italic; color: var(--gris); text-align: center; margin-top: calc(var(--fs) * .3); }
.illus .credit { display: block; font-style: italic; font-size: .85em; margin-top: .1em; }   /* source de la photographie, sous la légende (écran et impression) */
.page-corps .chapeau:not(.suite)::first-letter { font-family: var(--titre); font-size: 2.9em; float: left; line-height: .82; padding: .06em .08em 0 0; color: var(--navy); }   /* lettrine : pas sur la suite d'un chapeau coupé (petits écrans) */
.page-corps ul, .page-corps ol { padding-left: 1.35em; }
.page-corps li { margin-bottom: calc(var(--fs) * .3); }
.page-corps ul li::marker { color: var(--sable); }
.page-corps ol li::marker { color: var(--navy); font-weight: bold; }
.page-corps ol.code { list-style: none; padding-left: 0; counter-reset: art; }
.page-corps ol.code li { counter-increment: art; position: relative; padding-left: 2.4em; margin-bottom: calc(var(--fs) * .45); }
.page-corps ol.code li::before {
  content: counter(art); position: absolute; left: 0; top: .1em;
  width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--navy); color: #fff;
  font-family: var(--titre); font-size: .85em; display: flex; align-items: center; justify-content: center;
}
.page-corps .encadre {
  background: #F6F1E7; border-left: 4px solid var(--sable); padding: calc(var(--fs) * .55) calc(var(--fs) * .8);
  font-size: .95em; border-radius: 0 4px 4px 0;
}
.page-corps ul.liens { list-style: none; padding: 0; }
.page-corps ul.liens li { padding-left: 1em; text-indent: -1em; font-size: .9em; }

/* tableaux : entête marine, lignes fines, texte serré */
.page-corps table.t { width: 100%; border-collapse: collapse; font-size: calc(var(--fs) * .84); line-height: 1.32; }
.page-corps table.t th, .page-corps table.t td { padding: calc(var(--fs) * .28) calc(var(--fs) * .4); vertical-align: top; text-align: left; border-bottom: 1px solid #DCD6C8; }
.page-corps table.t thead th { background: var(--navy); color: #fff; font-weight: bold; border-bottom: 0; }
.page-corps table.t tbody td:first-child { color: var(--navy); font-weight: bold; }
.page-corps table.t tr.groupe th { background: #E9EEF6; color: var(--vert); font-family: var(--titre); font-weight: normal; font-size: 1.05em; letter-spacing: .04em; padding-top: calc(var(--fs) * .4); }
.page-corps table.t tbody tr:nth-child(even) td { background: rgba(31,56,100,.035); }
.page-corps table.t td.res { color: var(--vert); font-weight: bold; }
.page-corps table.dates td:first-child { white-space: nowrap; }
.page-corps table.urgences td:first-child { font-family: var(--titre); font-size: 1.35em; color: var(--band); }
.page-corps table.sigles td:first-child { white-space: nowrap; }
.page-corps table.internes td { height: calc(var(--fs) * 1.9); }
.page-corps table.internes td:nth-child(n+2) { border-bottom: 1px dotted #9a9a9a; }
.page-corps table.t.suite thead th { font-weight: bold; font-style: normal; background: var(--navy); }   /* entête de suite identique à la première */
.pastille { display: inline-block; width: .9em; height: .9em; border-radius: 50%; vertical-align: -.1em; margin-right: .35em; border: 1px solid rgba(0,0,0,.25); }
.pastille.or { background: linear-gradient(135deg, #F3D77A, #C9A227); }
.pastille.argent { background: linear-gradient(135deg, #F2F2F2, #A9AEB8); }
/* pages étroites (mode simple) : les tableaux à trois colonnes ou plus deviennent des fiches,
   chaque cellule rappelant l'intitulé de sa colonne ; le tableau des grades a sa propre mise en forme */
.livre.simple table.t3 thead { display: none; }
.livre.simple table.t3, .livre.simple table.t3 tbody, .livre.simple table.t3 tr, .livre.simple table.t3 td { display: block; }
.livre.simple table.t3 tr { border-bottom: 1px solid #DCD6C8; padding: calc(var(--fs) * .3) 0; }
.livre.simple table.t3 tr.groupe th { display: block; }
.livre.simple table.t3 td { border: 0; padding: .06em 0; background: none !important; }
.livre.simple table.t3 td:not(:first-child)::before { content: attr(data-th) " : "; font-weight: bold; color: var(--vert); }
.livre.simple table.t3 td:not(:first-child):empty { display: none; }
.livre.simple table.grades tr:not(.groupe) { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "d d"; column-gap: .8em; align-items: start; }
.livre.simple table.grades td:nth-child(1) { grid-area: a; }
.livre.simple table.grades td:nth-child(2) { grid-area: b; }
.livre.simple table.grades td:nth-child(3) { grid-area: d; padding-top: .3em; }
.livre.simple table.grades td[data-galon]::before { content: attr(data-th); display: block; font-size: .72em; font-weight: bold; letter-spacing: .06em; text-transform: uppercase; color: var(--vert); margin-bottom: .15em; }
.livre.simple table.grades td:nth-child(3)::before { content: "On lui dit : "; }
.livre.simple table.grades .gr { flex-direction: column; align-items: flex-start; gap: .25em; }
.livre.simple table.grades td { border-right: 0 !important; }
.livre.simple table.grades .gr-nom { font-size: .95em; }
.page-corps table.internes td:first-child { width: 46%; }
/* insignes de grade dessinés par bible.js : nom du grade à gauche, galon de poitrine à droite */
.gr { display: flex; align-items: center; justify-content: flex-start; gap: .55em; }
.gr-nom { flex: 1 1 auto; min-width: 0; }
.gr-nom small { display: block; }
.galons { display: flex; align-items: center; flex: none; }
.galons svg { width: 34px; height: 34px; flex: none; border-radius: 2px; box-shadow: 0 1px 1px rgba(0,0,0,.25); }
.page-corps table.grades td { vertical-align: middle; }   /* insignes alignés d'une colonne à l'autre */
.page-corps table.grades td[data-galon] { padding-top: calc(var(--fs) * .16); padding-bottom: calc(var(--fs) * .16); }
.page-corps table.grades th:not([colspan]), .page-corps table.grades td { border-right: 1px solid #DCD6C8; }   /* barres verticales entre colonnes */
.page-corps table.grades thead th:not([colspan]) { border-right-color: rgba(255,255,255,.35); }
.page-corps table.grades th:last-child, .page-corps table.grades td:last-child { border-right: 0; }
.page-corps table.grades thead th:nth-child(1) { width: 44%; }
.page-corps table.grades thead th:nth-child(2) { width: 22%; }   /* basse visibilité : l'insigne seul, commun à toutes les armes */
.page-corps table.grades thead th small { display: block; font-weight: normal; font-size: .78em; color: inherit; opacity: .8; }
.page-corps table.grades td[data-metal="bv"] .gr { justify-content: center; }
.page-corps table.grades td small { font-weight: normal; }

/* sommaire */
.som-secs { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--fs) * 1.2); margin: 0 0 calc(var(--fs) * .2) 1.9em; }
.livre.simple .som-secs { grid-template-columns: 1fr; }
.som-secs .som-ligne.sec { padding-left: 0; font-size: calc(var(--fs) * .82); line-height: 1.25; margin-bottom: calc(var(--fs) * .12); }
.som-ligne { display: flex; align-items: baseline; gap: .4em; margin: 0 0 calc(var(--fs) * .16); }
.som-ligne.chap { margin-top: calc(var(--fs) * .38); font-family: var(--titre); font-size: calc(var(--fs) * 1.06); color: var(--navy); }
.som-ligne.chap .som-num { font-size: .75em; color: var(--sable); letter-spacing: .1em; min-width: 1.6em; }
.som-ligne.sec { padding-left: 1.9em; font-size: calc(var(--fs) * .84); color: #333; line-height: 1.3; }
.som-ligne .som-txt { cursor: pointer; }
.som-ligne .som-txt:hover { color: var(--band); text-decoration: underline; }
.som-ligne .som-pts { flex: 1; border-bottom: 1px dotted #9a927f; min-width: 1em; transform: translateY(-.3em); }
.som-ligne .som-p { font-variant-numeric: tabular-nums; cursor: pointer; }
.som-intro { font-size: .9em; color: var(--gris); margin-bottom: calc(var(--fs) * .6); }

/* ----- couverture, page de garde, pages libres, quatrième de couverture ----- */
.page.couverture, .page.dos {
  background: var(--navy);
  background-image: radial-gradient(circle at 50% 30%, #2a4a85 0%, #1F3864 55%, #16294a 100%);
  color: #fff; padding: calc(var(--fs) * 1.2); text-align: center; align-items: stretch;
}
.couv-cadre {
  flex: 1; border: 1px solid rgba(180,155,108,.75); border-radius: 3px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--fs) * 1.6) calc(var(--fs) * 1.4);
  box-shadow: inset 0 0 0 4px rgba(31,56,100,1), inset 0 0 0 5px rgba(180,155,108,.45);
}
.couv-cadre::before, .couv-cadre::after { content: ""; position: absolute; left: 12%; right: 12%; height: 1px; background: linear-gradient(90deg, transparent, var(--sable), transparent); }
.couv-cadre::before { top: calc(var(--fs) * 1.1); }
.couv-cadre::after { bottom: calc(var(--fs) * 1.1); }
.couv-unite { font-size: calc(var(--fs) * .78); letter-spacing: .28em; text-transform: uppercase; color: var(--sable-clair); margin: 0 0 calc(var(--fs) * 1.2); }
.couv-insigne { width: 46%; max-width: 230px; height: auto; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); margin-bottom: calc(var(--fs) * 1.1); }
.couv-devise { font-size: calc(var(--fs) * .8); letter-spacing: .2em; text-transform: uppercase; color: #9fd3b4; margin: 0 0 calc(var(--fs) * 1.6); display: flex; align-items: center; gap: .8em; }
.couv-devise::before, .couv-devise::after { content: ""; width: 2.2em; height: 1px; background: var(--sable); }
.couv-titre { font-family: var(--titre); font-weight: normal; font-size: calc(var(--fs) * 3.1); line-height: 1; margin: 0 0 calc(var(--fs) * .5); letter-spacing: .01em; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.couv-titre small { display: block; font-size: .42em; letter-spacing: .3em; text-transform: uppercase; color: var(--sable-clair); margin-top: calc(var(--fs) * .6); }
.couv-regiment { font-family: var(--titre); font-size: calc(var(--fs) * 1.25); color: #fff; margin: calc(var(--fs) * 1.2) 0 0; }
.couv-regiment small { display: block; font-family: var(--font); font-size: calc(var(--fs) * .72); letter-spacing: .18em; text-transform: uppercase; color: var(--sable-clair); margin-top: .4em; }
.couv-edition { position: absolute; bottom: calc(var(--fs) * 1.9); left: 0; right: 0; font-size: calc(var(--fs) * .7); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.page.dos .couv-cadre { justify-content: space-between; }
.dos-texte { font-family: var(--titre); font-size: calc(var(--fs) * 1.05); line-height: 1.5; color: #fff; max-width: 34em; margin: calc(var(--fs) * 1.5) 0; }
.dos-texte em { color: var(--sable-clair); font-style: italic; }
.dos-pied { font-size: calc(var(--fs) * .78); color: rgba(255,255,255,.8); line-height: 1.6; }
.dos-pied a { color: #fff; }
.coeur { display: inline-block; width: 1.05em; height: 1.05em; vertical-align: -.18em; fill: #FF7A8A; }

.page.garde .page-corps { display: flex; flex-direction: column; justify-content: center; }
.garde-titre { font-family: var(--titre); font-size: calc(var(--fs) * 1.7); color: var(--navy); text-align: center; margin: 0 0 calc(var(--fs) * .3); }
.garde-sous { text-align: center; font-size: calc(var(--fs) * .78); letter-spacing: .2em; text-transform: uppercase; color: var(--gris); margin: 0 0 calc(var(--fs) * 2.2); }
.garde-champ { display: flex; align-items: baseline; gap: .6em; margin: 0 0 calc(var(--fs) * 1.3); font-size: calc(var(--fs) * .95); color: var(--navy); }
.garde-champ span { flex: 1; border-bottom: 1px solid #8a8a8a; min-height: 1.4em; }
.garde-note { font-size: calc(var(--fs) * .82); color: var(--gris); margin-top: calc(var(--fs) * 2); line-height: 1.5; }
.garde-note strong { color: var(--vert); }
.garde-mode { margin-top: calc(var(--fs) * 1.5); font-size: calc(var(--fs) * .86); color: #333; background: #F6F1E7; border-left: 4px solid var(--sable); padding: calc(var(--fs) * .55) calc(var(--fs) * .8); border-radius: 0 4px 4px 0; }

.page.blanche .page-corps { background-image: repeating-linear-gradient(180deg, transparent 0 calc(var(--fs) * 1.6), #D9D2C2 calc(var(--fs) * 1.6) calc(var(--fs) * 1.6 + 1px)); position: relative; }
.page.blanche .page-corps::before { content: attr(data-libre); position: absolute; top: -.2em; left: 0; font-size: calc(var(--fs) * .78); letter-spacing: .12em; text-transform: uppercase; color: var(--gris); background: var(--papier); padding-right: .6em; }
.page.blanche .page-corps::after { content: ""; position: absolute; inset: 0; background: url(assets/insigne-503.png) no-repeat 50% 50% / 46%; opacity: .07; pointer-events: none; }

/* ---------- impression : l'édition A4 construite par bible.js ; la source, masquée à l'écran,
   ne s'imprime plus qu'en repli (édition impossible à construire) ---------- */
.source, .imp-edition { display: none; }
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { height: auto; overflow: visible; background: #fff; color: #000; }
  .app { display: none; }
  /* une page du livre par feuille, à la taille mesurée par bible.js (716 × 1044 px) ; fonds imprimés
     même sans l'option « graphiques d'arrière-plan » (couvertures, entêtes de tableaux, pages de notes) */
  .imp-edition { display: block; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .edition-prete .source { display: none; }
  .imp-edition .page { position: relative; inset: auto; border-radius: 0; break-after: page; page-break-after: always; }
  .imp-edition .page:last-child { break-after: auto; page-break-after: auto; }
  .imp-edition .page:not(.couverture):not(.dos) { background: #fff; }
  .imp-edition .page.couverture, .imp-edition .page.dos { --fs: 23px; }   /* couvertures à l'échelle de la feuille */
  .imp-edition .couv-insigne { max-width: none; }
  .imp-edition .garde-mode { visibility: hidden; }   /* mode d'emploi du livre à l'écran */
  .source { display: block; color: #000; font: 11pt/1.4 var(--font); }
  .source .chapitre { page-break-before: always; break-before: page; }
  .source .chapitre:first-child { page-break-before: auto; }
  .source h2 { font-family: var(--titre); font-weight: normal; font-size: 22pt; color: var(--navy); border-bottom: 2px solid var(--vert); padding-bottom: 4pt; margin: 0 0 10pt; }
  .source h3 { font-family: var(--titre); font-weight: normal; font-size: 14pt; color: var(--vert); margin: 12pt 0 4pt; page-break-after: avoid; }
  .source table { width: 100%; border-collapse: collapse; font-size: 9.5pt; page-break-inside: auto; }
  .source tr { page-break-inside: avoid; }
  .source th, .source td { border: 1px solid #bbb; padding: 3pt 5pt; vertical-align: top; text-align: left; }
  .source thead th { background: #E9EEF6; color: var(--navy); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .source .illus { margin: 8pt 0 10pt; page-break-inside: avoid; }
  .source .illus img { display: block; width: 100%; height: auto; }
  .source .illus figcaption { font-size: 9pt; font-style: italic; color: #555; text-align: center; margin-top: 3pt; }
  .source .gr { display: flex; align-items: center; justify-content: space-between; gap: 4pt; }
  .source .galons svg { width: 26pt; height: 26pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .source table.grades td[data-metal="argent"] { width: 44%; }
  .source table.grades td[data-metal="bv"] { width: 18%; }
  .source tr.groupe th { background: #F3F0E6; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .source .encadre { border-left: 3pt solid var(--sable); padding: 4pt 8pt; }
  .source a { color: #000; text-decoration: none; }
  .source ul.liens a::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
}

/* ---------- écrans étroits ---------- */
@media (max-width: 640px) {
  .barre { padding: 6px 10px; }
  #btn-plein { display: none; }
  .scene { padding: 8px 8px; }
  .chapitres select { max-width: 42vw; font-size: 13px; }
  .indicateur { min-width: 70px; font-size: 12px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .barre.bas { min-height: 42px; padding: 4px 10px; }
}
