/* Quilalu — feuille de styles (refonte de l'interface, 18/10/2026).
 *
 * Trois thèmes, choisis par personne (apps.foyers.preferences) et posés par le serveur sur
 * <html data-theme="…"> : Rayonnage (adultes, par défaut), Veillée (sombre, au choix),
 * Marelle (enfants, par défaut). Un thème ne change que des jetons (couleurs, polices,
 * arrondis, reliefs) : toutes les pages utilisent les mêmes classes. Aucun style en ligne
 * (politique de sécurité du contenu). Polices auto-hébergées, licence OFL (dossier fonts).
 * La console garde sa propre feuille (console.css).
 */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-600-normal.72280bf66ee0.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.5beb2f653e74.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.f1f8a8210104.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.13a58e05dfd2.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/instrument-serif-latin-400-normal.9b8dd1ecf641.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/instrument-serif-latin-400-italic.bc891bdd08ad.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-400-normal.503e7cbdb484.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-600-normal.79e62f3332cd.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("../fonts/plus-jakarta-sans-latin-700-normal.5b629bd8abb4.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("../fonts/fredoka-latin-500-normal.d0feaff862a7.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("../fonts/fredoka-latin-600-normal.f56ba4069e24.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 400; font-display: swap; src: url("../fonts/lexend-latin-400-normal.deb3728b3468.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-weight: 600; font-display: swap; src: url("../fonts/lexend-latin-600-normal.9b13427c526f.woff2") format("woff2"); }

/* --- Jetons ------------------------------------------------------------------------------- */

/* Rayonnage : clair et net, l'étagère en avant (aussi le thème des pages sans compte). */
:root, [data-theme="rayonnage"] {
  color-scheme: light;
  --fond: #F6F6F2;
  --surface: #FFFFFF;
  --surface-douce: #FAFAF7;
  --creux: #EAEAE3;
  --barre-fond: #FFFFFF;
  --encre: #16181D;
  --discret: #4A4F59;
  --pale: #6B7080;
  --bordure: #E3E3DC;
  --bordure-legere: #EFEFE9;
  --bordure-forte: #C9CAC0;
  --accent: #1F3FCC;
  --accent-fonce: #142C96;
  --sur-accent: #FFFFFF;
  --accent-doux: #E6ECFF;
  --lien: #1F3FCC;
  --lien-survol: #142C96;
  --vif: #FF6B3D;
  --sur-vif: #2A0E03;
  --sombre: #16181D;
  --sombre-survol: #33363F;
  --sur-sombre: #FFFFFF;
  --emprunt: #6A4FD6;
  --emprunt-doux: #ECE7FF;
  --emprunt-texte: #4A33A8;
  --ok: #1E8A55;
  --ok-doux: #DDF3E6;
  --ok-texte: #155E3A;
  --pret-doux: #FFE3DC;
  --pret-texte: #9A2F17;
  --attente-doux: #FFF1BF;
  --attente-texte: #6B4E00;
  --attente-bord: #EBD58A;
  --attente-fond: #FFFBEA;
  --cours-doux: #DFF1F8;
  --cours-texte: #0B5C78;
  --lire-doux: #E6ECFF;
  --lire-texte: #1F3FCC;
  --envie-doux: #FCE4EF;
  --envie-texte: #9C1F5E;
  --neutre-doux: #EDEDE6;
  --neutre-texte: #4A4F59;
  --non-lu: #F1F4FF;
  --danger: #B3264A;
  --danger-survol: #8E1C3A;
  --danger-doux: #FFF1F4;
  --danger-texte: #9E2643;
  --danger-bord: #F0C3CF;
  --retard-fond: #FFF4E8;
  --retard-bord: #F3D3B0;
  --retard-texte: #6E3A0E;
  --planche: #D8D2C4;
  --planche-ombre: #C4BDAC;
  --anneau-fond: #E8EBF8;
  --etoile: #1F3FCC;
  --coeur: #D11F45;
  --coeur-doux: #FDE8EC;
  --coeur-texte: #A0122F;
  --focus: rgba(31, 63, 204, .4);
  --ombre-carte: none;
  --ombre-menu: 0 18px 40px -16px rgba(22, 24, 29, .35);
  --ombre-bouton: none;
  --ombre-couverture: inset 4px 0 0 rgba(0, 0, 0, .18), 0 8px 14px -8px rgba(22, 24, 29, .45);
  --titre: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --graisse-titre: 800;
  --espacement-titre: -0.02em;
  --taille: 15px;
  --taille-h1: 44px;
  --taille-h2: 22px;
  --rayon: 12px;
  --rayon-carte: 18px;
  --rayon-bouton: 999px;
  --hauteur-bouton: 44px;
}

/* Veillée : sombre et chaleureux, pour lire le soir. */
[data-theme="veillee"] {
  color-scheme: dark;
  --fond: #11181F;
  --surface: #18222C;
  --surface-douce: #1C2731;
  --creux: #202D39;
  --barre-fond: #141D25;
  --encre: #EFE8DC;
  --discret: #A7B1BB;
  --pale: #8794A1;
  --bordure: #2A3A48;
  --bordure-legere: #22303C;
  --bordure-forte: #3A4C5C;
  --accent: #F5B942;
  --accent-fonce: #FFD27A;
  --sur-accent: #1F1503;
  --accent-doux: #3A3018;
  --lien: #F5C95A;
  --lien-survol: #FFD27A;
  --vif: #F5B942;
  --sur-vif: #1F1503;
  --sombre: #EFE8DC;
  --sombre-survol: #FFFFFF;
  --sur-sombre: #11181F;
  --emprunt: #C7B8FF;
  --emprunt-doux: #2A2648;
  --emprunt-texte: #C7B8FF;
  --ok: #8BE6C9;
  --ok-doux: #173A31;
  --ok-texte: #8BE6C9;
  --pret-doux: #3A2228;
  --pret-texte: #FFA3B1;
  --attente-doux: #3A3018;
  --attente-texte: #F5C95A;
  --attente-bord: #5C4A20;
  --attente-fond: #231F14;
  --cours-doux: #163542;
  --cours-texte: #7FD6EA;
  --lire-doux: #1C2C44;
  --lire-texte: #9CC4FF;
  --envie-doux: #3A2233;
  --envie-texte: #FFA3C8;
  --neutre-doux: #22303C;
  --neutre-texte: #B8C1CA;
  --non-lu: #202D39;
  --danger: #E0647E;
  --danger-survol: #F07F96;
  --danger-doux: #2E1C22;
  --danger-texte: #FFA3B1;
  --danger-bord: #6A3340;
  --retard-fond: #2A2116;
  --retard-bord: #5C4428;
  --retard-texte: #F5C98A;
  --planche: #5A4632;
  --planche-ombre: #3E3022;
  --anneau-fond: #2A3A48;
  --etoile: #F5B942;
  --coeur: #FF6F8E;
  --coeur-doux: #3B1F27;
  --coeur-texte: #FFB3C3;
  --focus: rgba(245, 185, 66, .5);
  --ombre-carte: none;
  --ombre-menu: 0 18px 40px -12px rgba(0, 0, 0, .8);
  --ombre-bouton: none;
  --ombre-couverture: inset 4px 0 0 rgba(0, 0, 0, .25), 0 8px 14px -8px rgba(0, 0, 0, .8);
  --titre: "Instrument Serif", Georgia, serif;
  --texte: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --graisse-titre: 400;
  --espacement-titre: 0;
  --taille-h1: 50px;
  --taille-h2: 28px;
  --rayon: 14px;
  --rayon-carte: 20px;
  --rayon-bouton: 14px;
}

/* Marelle : gros boutons et couleurs vives (comptes enfants, par défaut). */
[data-theme="marelle"] {
  color-scheme: light;
  --fond: #E9F5FF;
  --surface: #FFFFFF;
  --surface-douce: #F5FAFF;
  --creux: #DCEBF8;
  --barre-fond: #E9F5FF;
  --encre: #1B2A41;
  --discret: #3A4B66;
  --pale: #5A6B84;
  --bordure: #C7DDF0;
  --bordure-legere: #E1EDF8;
  --bordure-forte: #9DBEDC;
  --accent: #1D5FD1;
  --accent-fonce: #123F8F;
  --sur-accent: #FFFFFF;
  --accent-doux: #E3EEFF;
  --lien: #1D5FD1;
  --lien-survol: #123F8F;
  --vif: #FF8A3D;
  --sur-vif: #2B1100;
  --sombre: #1B2A41;
  --sombre-survol: #2C3F5E;
  --sur-sombre: #FFFFFF;
  --emprunt: #7B5CC4;
  --emprunt-doux: #EEE7FF;
  --emprunt-texte: #5B3FB0;
  --ok: #1E9E5A;
  --ok-doux: #DDF5E7;
  --ok-texte: #14663A;
  --pret-doux: #FFE3DC;
  --pret-texte: #9A2F17;
  --attente-doux: #FFF1BF;
  --attente-texte: #6B4E00;
  --attente-bord: #EBD58A;
  --attente-fond: #FFFBEA;
  --cours-doux: #FFF4EB;
  --cours-texte: #8A3A00;
  --lire-doux: #E3EEFF;
  --lire-texte: #123F8F;
  --envie-doux: #FFE3F1;
  --envie-texte: #9C1F5E;
  --neutre-doux: #EEF3F8;
  --neutre-texte: #3A4B66;
  --non-lu: #F2F8FF;
  --danger: #C0304F;
  --danger-survol: #9A2440;
  --danger-doux: #FFF1F4;
  --danger-texte: #9E2643;
  --danger-bord: #F0C3CF;
  --retard-fond: #FFF4EB;
  --retard-bord: #FFD2AE;
  --retard-texte: #8A3A00;
  --planche: #FFD9A8;
  --planche-ombre: #F2B97A;
  --anneau-fond: #DCEBF8;
  --etoile: #F2A900;
  --coeur: #E0244B;
  --coeur-doux: #FFE5EA;
  --coeur-texte: #A0122F;
  --focus: rgba(29, 95, 209, .4);
  --ombre-carte: 0 5px 0 #C7DDF0;
  --ombre-menu: 0 8px 0 #C7DDF0, 0 18px 40px -16px rgba(27, 42, 65, .35);
  --ombre-bouton: 0 4px 0 var(--accent-fonce);
  --ombre-couverture: 0 4px 0 rgba(27, 42, 65, .18);
  --titre: "Fredoka", "Segoe UI", system-ui, sans-serif;
  --texte: "Lexend", "Segoe UI", system-ui, sans-serif;
  --graisse-titre: 600;
  --espacement-titre: 0;
  --taille: 17px;
  --taille-h1: 48px;
  --taille-h2: 26px;
  --rayon: 16px;
  --rayon-carte: 26px;
  --rayon-bouton: 999px;
  --hauteur-bouton: 52px;
}

/* --- Base --------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: var(--taille); line-height: 1.5; }
a { color: var(--lien); }
a:hover { color: var(--lien-survol); }
h1, h2, h3 { font-family: var(--titre); font-weight: var(--graisse-titre); letter-spacing: var(--espacement-titre); line-height: 1.08; margin: 0; }
h1 { font-size: var(--taille-h1); }
h2 { font-size: var(--taille-h2); }
h3 { font-size: 19px; }
strong, b { font-weight: 700; }
small { font-size: 13px; }
img { max-width: 100%; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: var(--rayon); background: var(--sombre); color: var(--sur-sombre); font-weight: 700; text-decoration: none; }
.evitement:focus { top: 12px; color: var(--sur-sombre); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.contenu:focus { outline: none; }

/* --- Barre du haut ------------------------------------------------------------------------ */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; min-height: 68px; padding: 0 40px; background: var(--barre-fond); border-bottom: 1px solid var(--bordure); }
.marque { display: flex; align-items: center; gap: 8px; color: var(--encre); text-decoration: none; flex: 0 0 auto; }
.marque:hover { color: var(--encre); }
.marque .logo { display: block; height: 32px; width: auto; }
.marque .logo-sombre { display: none; }
[data-theme="veillee"] .marque .logo-clair { display: none; }
[data-theme="veillee"] .marque .logo-sombre { display: block; }
.marque span { font-family: var(--titre); font-size: 26px; font-weight: var(--graisse-titre); letter-spacing: -0.02em; line-height: 1; }
.barre-liens { display: flex; align-self: stretch; gap: 2px; margin-left: 10px; }
.barre-liens a { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--discret); text-decoration: none; font-weight: 400; white-space: nowrap; }
.barre-liens a:hover { color: var(--encre); }
.barre-liens a[aria-current="page"] { color: var(--encre); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.compteur { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--vif); color: var(--sur-vif); font-size: 12px; font-weight: 700; line-height: 1; }
.barre-recherche { position: relative; flex: 1 1 auto; max-width: 420px; margin-left: auto; color: var(--pale); }
.barre-recherche svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.barre-recherche input[type=search] { min-height: 42px; padding: 0 16px 0 42px; border-radius: 999px; background: var(--fond); }
.barre-loupe { display: none; margin-left: auto; }
.barre-loupe > summary { list-style: none; position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border-radius: 22px; color: var(--encre); }
.barre-loupe > summary::-webkit-details-marker { display: none; }
.barre-loupe .loupe-annuler { display: none; font-weight: 700; color: var(--lien); padding: 0 6px; }
.barre-loupe[open] .loupe-ouvrir { display: none; }
.barre-loupe[open] .loupe-annuler { display: inline; }
/* Champ ouvert : il recouvre toute la barre (marque, et initiale d'un compte enfant) ;
   « Annuler » prend le bord droit, sur le fond de la barre. */
.barre-loupe[open] > summary { position: absolute; z-index: 4; top: 0; bottom: 0; right: 0; width: 104px; height: auto; border-radius: 0; background: var(--barre-fond); }
.loupe-formulaire { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; right: 104px; display: flex; align-items: center; padding-left: 12px; background: var(--barre-fond); color: var(--pale); }
.loupe-formulaire svg { position: absolute; left: 26px; pointer-events: none; }
.loupe-formulaire input[type=search] { width: 100%; min-height: 44px; padding: 0 14px 0 40px; border-radius: 999px; border: 2px solid var(--accent); background: var(--surface); }
.barre-compte { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.barre-compte form { margin: 0; }
.avatar { width: 44px; height: 44px; font-size: 18px; text-decoration: none; }
.avatar:hover { color: #FFFFFF; filter: brightness(1.08); }
.avatar[aria-current="page"] { box-shadow: 0 0 0 3px var(--barre-fond), 0 0 0 5px var(--accent); }

/* Menu « + Ajouter » : un <details> (sans script, il s'ouvre et se ferme au clic ; avec script,
   il se ferme aussi en cliquant ailleurs ou avec Échap, app.js). */
.menu-ajouter { position: relative; flex: 0 0 auto; }
.menu-ajouter > summary { list-style: none; gap: 6px; }
.menu-ajouter > summary::-webkit-details-marker { display: none; }
.menu-liste { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 280px; margin: 0; padding: 8px; list-style: none; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); box-shadow: var(--ombre-menu); }
.menu-liste a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--rayon); color: var(--encre); font-weight: 700; text-decoration: none; }
.menu-liste a:hover { background: var(--creux); color: var(--encre); }
.menu-liste small { font-weight: 400; color: var(--discret); }

.contenu { width: 100%; max-width: 1320px; margin: 0 auto; padding: 30px 40px 64px; display: flex; flex-direction: column; gap: 24px; }

/* Onglets du bas : téléphone seulement. */
.onglets { display: none; }
.onglets a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; color: var(--discret); font-size: 12px; text-decoration: none; }
.onglets a[aria-current="page"] { color: var(--accent); font-weight: 700; }
[data-theme="veillee"] .onglets a[aria-current="page"] { color: var(--accent); }
.onglet-icone { position: relative; display: inline-flex; }
.onglet-icone .compteur { position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; box-shadow: 0 0 0 2px var(--barre-fond); }
.onglet-scanner { font-size: 0; }
.onglet-scanner .onglet-rond { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; margin-top: -18px; border-radius: 29px; background: var(--sombre); color: var(--sur-sombre); box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .45); }
[data-theme="veillee"] .onglet-scanner .onglet-rond, [data-theme="marelle"] .onglet-scanner .onglet-rond { background: var(--vif); color: var(--sur-vif); }
.onglet-scanner[aria-current="page"] .onglet-rond { box-shadow: 0 0 0 3px var(--barre-fond), 0 0 0 6px var(--accent); }
.initiale.mini { width: 26px; height: 26px; font-size: 13px; }

@media (max-width: 1100px) {
  .barre { padding: 0 24px; gap: 12px; }
  .barre-recherche { display: none; }
  .barre-loupe { display: block; }
  .contenu { padding: 26px 24px 56px; }
}
@media (max-width: 760px) {
  .barre { min-height: 60px; padding: 0 16px; gap: 6px; }
  .marque .logo { height: 26px; }
  .marque span { font-size: 22px; }
  .barre-liens, .menu-ajouter, .barre .barre-scanner { display: none; }
  body.avec-onglets .avatar:not(.avatar-enfant) { display: none; }
  .avatar { width: 40px; height: 40px; }
  .onglets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); background: var(--barre-fond); border-top: 1px solid var(--bordure); }
  .onglets.onglets-enfant { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.avec-onglets .contenu { padding-bottom: 120px; }
  .contenu { padding: 18px 16px 48px; gap: 18px; }
  h1 { font-size: calc(var(--taille-h1) * .68); }
  h2 { font-size: calc(var(--taille-h2) * .9); }
}
@media (max-width: 359px) {
  .marque span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* --- Éléments ----------------------------------------------------------------------------- */
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.sous-titre { color: var(--discret); font-size: 14px; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--hauteur-bouton); padding: 0 20px; border-radius: var(--rayon-bouton); border: 0; background: var(--accent); color: var(--sur-accent); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: var(--ombre-bouton); }
.bouton:hover { background: var(--accent-fonce); color: var(--sur-accent); }
[data-theme="veillee"] .bouton:hover { background: var(--accent-fonce); }
.bouton.secondaire { background: var(--surface); color: var(--encre); border: 1px solid var(--bordure-forte); font-weight: 700; box-shadow: none; }
.bouton.secondaire:hover { background: var(--creux); color: var(--encre); }
.bouton.sombre { background: var(--sombre); color: var(--sur-sombre); box-shadow: none; }
.bouton.sombre:hover { background: var(--sombre-survol); color: var(--sur-sombre); }
[data-theme="marelle"] .bouton.sombre, [data-theme="marelle"] .barre-scanner { background: var(--vif); color: var(--sur-vif); box-shadow: 0 4px 0 #C9601C; }
.bouton.danger { background: var(--danger); color: #FFFFFF; box-shadow: none; }
[data-theme="veillee"] .bouton.danger { color: #1A0A0E; }
.bouton.danger:hover { background: var(--danger-survol); }
.bouton.petit { min-height: 38px; padding: 0 14px; font-size: 14px; }
[data-theme="marelle"] .bouton.petit { min-height: 44px; font-size: 15px; }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.bouton[hidden] { display: none; }
.bouton.secondaire.risque { color: var(--danger-texte); border-color: var(--danger-bord); }
.bouton.secondaire.risque:hover { background: var(--danger-doux); }
.lien-bouton { background: none; border: 0; padding: 4px 0; color: var(--lien); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 44px; }
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--ombre-carte); }
[data-theme="marelle"] .carte { border-color: transparent; }
.carte.danger { border-color: var(--danger-bord); }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastille { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--encre); text-decoration: none; font-size: 14px; }
.pastille[aria-current="true"] { background: var(--sombre); border-color: var(--sombre); color: var(--sur-sombre); font-weight: 700; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.35; padding: 2px 9px; border-radius: 999px; background: var(--neutre-doux); color: var(--neutre-texte); }
.badge.dispo, .badge.abandonne, .badge.aussi, .badge.refusee, .badge.format { background: var(--neutre-doux); color: var(--neutre-texte); }
.badge.prete, .badge.demande { background: var(--pret-doux); color: var(--pret-texte); }
.badge.a_lire { background: var(--lire-doux); color: var(--lire-texte); }
.badge.envie { background: var(--envie-doux); color: var(--envie-texte); }
.badge.lu { background: var(--ok-doux); color: var(--ok-texte); }
.badge.en_cours { background: var(--cours-doux); color: var(--cours-texte); }
.badge.emprunte, .badge.a_recuperer { background: var(--emprunt-doux); color: var(--emprunt-texte); }
.badge.a_remettre { background: var(--attente-doux); color: var(--attente-texte); }
.badge.retard { background: var(--retard-fond); color: var(--retard-texte); }
.badge.serie { background: var(--sombre); color: var(--sur-sombre); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.etoiles { display: inline-flex; gap: 1px; color: var(--etoile); font-size: 13px; vertical-align: middle; }
.etoiles svg, .fil-etoiles svg, .etoiles-badge svg { display: block; }
.etoiles-badge { display: inline-flex; gap: 1px; vertical-align: -0.1em; }
/* Coup de cœur (25/10/2026) : sur la fiche (bouton de « Ma lecture », pastille des avis) et
   sur la couverture des cartes (le mien). */
.pastille-coeur { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--coeur-doux); color: var(--coeur-texte); font-size: 12px; font-weight: 700; line-height: 1.4; }
.form-coeur { display: inline-flex; margin: 0; }
.bouton-coeur { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--bordure-forte); border-radius: 20px; background: var(--surface); color: var(--discret); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bouton-coeur svg { fill: none; stroke: currentColor; stroke-width: 2; }
.bouton-coeur[aria-pressed="true"] { border: 2px solid var(--coeur); background: var(--coeur-doux); color: var(--coeur-texte); padding: 0 13px; }
.bouton-coeur[aria-pressed="true"] svg { fill: currentColor; }
.case-coeur { align-self: flex-start; }
.case-coeur svg { fill: var(--coeur); flex: 0 0 auto; }
.coeur-couverture { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 13px; background: var(--surface); color: var(--coeur); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.coeur-couverture svg { fill: currentColor; }
[data-theme="marelle"] .coeur-couverture { top: auto; bottom: 10px; }
.avis-marques { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.etoiles.grandes { font-size: 17px; }
/* Lot « Envies et avis » : avis des autres sous mes étoiles, envie sur la fiche, bouton
   « Ajouter à mes envies » du scan. */
.avis-autres { font-size: 13px; color: var(--discret); }
.avis-autres .etoile-seule { color: var(--pale); }
.avis-autres .coeurs-autres { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.avis-autres .coeurs-autres svg { color: var(--coeur); flex: 0 0 auto; }
.avis-autres span[aria-hidden] + .coeurs-autres { margin-left: 8px; }
.mon-envie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.mon-envie form { margin: 0; }
.bouton-envie { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.scan-envie { margin: 0; grid-column: 1 / -1; }
.scan-boutons .bouton-envie { white-space: nowrap; }

/* Formulaires */
form .champ { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 14px; font-weight: 700; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=tel], textarea, select {
  min-height: 44px; padding: 10px 12px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon); background: var(--surface); color: var(--encre); font: inherit; width: 100%;
}
[data-theme="marelle"] input[type=text], [data-theme="marelle"] input[type=search], [data-theme="marelle"] input[type=email], [data-theme="marelle"] input[type=password], [data-theme="marelle"] input[type=number], [data-theme="marelle"] input[type=date], [data-theme="marelle"] textarea, [data-theme="marelle"] select { min-height: 52px; border-width: 2px; }
input::placeholder, textarea::placeholder { color: var(--pale); }
textarea { min-height: 200px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.aide { font-size: 13px; color: var(--discret); }
.erreur { color: var(--danger-texte); font-size: 14px; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: var(--rayon); background: var(--ok-doux); color: var(--ok-texte); font-weight: 700; }
.messages li.error { background: var(--danger-doux); color: var(--danger-texte); }
.messages li.warning { background: var(--attente-doux); color: var(--attente-texte); }
.info { padding: 12px 16px; border-radius: var(--rayon); background: var(--accent-doux); color: var(--encre); }
.colonnes { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.colonnes > .principal { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.colonnes > .lateral { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Verdict de vérification */
.verdict { border-radius: var(--rayon-carte); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.verdict.meme_edition, .verdict.autre_edition { background: var(--accent); color: var(--sur-accent); }
.verdict.chez_un_proche { background: var(--pret-doux); color: var(--pret-texte); }
.verdict.absent { background: var(--attente-doux); color: var(--attente-texte); }
.verdict h2 { font-size: 26px; }
.verdict a { color: inherit; }

.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th { text-align: left; color: var(--discret); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--bordure); }
.tableau td { padding: 8px 10px; border-bottom: 1px solid var(--bordure-legere); }
.tableau td.nombre, .tableau th.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.defilement { overflow-x: auto; }
progress.progression { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 5px; background: var(--anneau-fond); overflow: hidden; }
progress.progression::-webkit-progress-bar { background: var(--anneau-fond); border-radius: 5px; }
progress.progression::-webkit-progress-value { background: var(--accent); border-radius: 5px; }
progress.progression::-moz-progress-bar { background: var(--accent); border-radius: 5px; }
progress.progression.atteinte::-webkit-progress-value { background: var(--ok); }
progress.progression.atteinte::-moz-progress-bar { background: var(--ok); }

.connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.connexion .carte { width: 100%; max-width: 420px; padding: 28px; gap: 16px; }

/* Couvertures dessinées et initiales : une teinte par œuvre ou par personne, choisie par le
   serveur (classe, jamais style en ligne). Texte blanc lisible dans les trois thèmes. */
.teinte-0 { background: #0F7F7A; } .teinte-1 { background: #8E3B46; } .teinte-2 { background: #B5562A; }
.teinte-3 { background: #2F6B4F; } .teinte-4 { background: #5B4B8A; } .teinte-5 { background: #3D5A80; }
.teinte-6 { background: #6A4C93; } .teinte-7 { background: #8A6A1B; }

/* Petites mises en page réutilisées par les gabarits (remplacent les styles en ligne). */
.sans-marge { margin: 0; }
.rangee { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rangee-haut { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.liste-simple { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.liste-simple li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.etroit { max-width: 520px; }
.moyen { max-width: 720px; }
.recherche { display: flex; gap: 10px; flex: 0 1 420px; }
.case { display: flex; gap: 10px; align-items: center; font-weight: 400; min-height: 44px; font-size: 15px; }
.case input { width: 20px; height: 20px; accent-color: var(--accent); }
.debut { align-self: flex-start; }
details > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.depliant-contenu { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

/* --- Bibliothèque : accueil, objectif, « À traiter », filtres, étagère ---------------------- */
.accueil { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; }
.accueil-texte { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.accueil-texte p { margin: 0; color: var(--discret); font-size: 16px; }
.empruntes-en-cours { color: var(--emprunt-texte); }
.anneau-objectif { display: flex; align-items: center; gap: 16px; padding: 10px 20px 10px 10px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); color: var(--encre); text-decoration: none; box-shadow: var(--ombre-carte); }
.anneau-objectif:hover { color: var(--encre); border-color: var(--bordure-forte); }
.anneau-objectif > span { display: flex; flex-direction: column; }
.anneau-objectif strong { font-size: 16px; }
.anneau-objectif span span { color: var(--discret); }
.anneau { flex: 0 0 auto; display: block; }
.anneau .piste { fill: none; stroke: var(--anneau-fond); stroke-width: 7; }
.anneau .valeur { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; }
.anneau.atteint .valeur { stroke: var(--ok); }
.anneau text { fill: var(--encre); font-family: var(--titre); font-size: 17px; font-weight: var(--graisse-titre); }
.objectif-reglage { flex: 1 1 100%; }
.objectif-reglage > summary { list-style: none; font-weight: 700; color: var(--lien); }
.objectif-reglage > summary::-webkit-details-marker { display: none; }
.objectif-reglage[open] > .depliant-contenu { padding: 16px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
.seulement-telephone { display: none; }
.rappel-recherche { padding: 10px 16px; border-radius: var(--rayon-carte); background: var(--accent-doux); color: var(--encre); }
.couverture.avec-pastille .typo > span { display: none; }
.accueil > .objectif-reglage[open] { flex: 1 1 100%; display: flex; flex-direction: column; align-items: flex-end; }
.accueil > .objectif-reglage[open] > .depliant-contenu { align-self: stretch; }

.a-traiter { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 80px; }
.a-traiter-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a-traiter-tete h2 { font-size: 22px; }
.a-traiter-tete .compteur { min-width: 26px; height: 26px; font-size: 14px; border-radius: 13px; }
.a-traiter-tete form { margin: 0 0 0 auto; }
.a-traiter-resume { color: var(--discret); }
.a-traiter.reduit { flex-direction: row; align-items: center; gap: 12px; padding: 6px 8px 6px 18px; min-height: 56px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 999px; box-shadow: var(--ombre-carte); }
.a-traiter.reduit .a-traiter-tete { flex: 1 1 auto; }
[data-theme="veillee"] .a-traiter.reduit { border-radius: var(--rayon-carte); }
.bouton-plier { gap: 6px; }
.cartes-a-traiter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.carte-traiter { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); min-width: 0; }
[data-theme="marelle"] .carte-traiter { border-color: transparent; }
.mini-couverture { flex: 0 0 52px; height: 78px; border-radius: 3px 5px 5px 3px; overflow: hidden; box-shadow: var(--ombre-couverture); }
.mini-couverture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-traiter-corps { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.carte-traiter-corps .badge { align-self: flex-start; }
.carte-traiter-corps > span > a { color: var(--encre); text-decoration: none; }
.carte-traiter-corps > span > a:hover { color: var(--lien); text-decoration: underline; }
.carte-traiter-corps .boutons { margin-top: auto; padding-top: 4px; }
.carte-traiter-corps form { margin: 0; }
.mot-court { font-size: 14px; color: var(--discret); font-style: italic; }
.a-traiter-pied { margin: 0; display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-weight: 700; }

/* Étapes d'un prêt : Demandé → Accepté → Remis (ou Récupéré) → Rendu. Affichage seul, calculé
   par le serveur. Bleu pour un prêt, violet pour un emprunt. */
.etapes-pret { --couleur-etape: var(--accent); --doux-etape: var(--accent-doux); position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 6px 0 4px; padding: 0; list-style: none; font-size: 12px; text-align: center; }
.etapes-pret.emprunt { --couleur-etape: var(--emprunt); --doux-etape: var(--emprunt-doux); }
.etapes-pret::before, .etapes-pret::after { content: ""; position: absolute; top: 7px; left: 12.5%; height: 3px; border-radius: 2px; }
.etapes-pret::before { right: 12.5%; background: var(--bordure); }
.etapes-pret::after { width: 0; background: var(--couleur-etape); }
.etapes-pret.etape-2::after { width: 25%; }
.etapes-pret.etape-3::after { width: 50%; }
.etapes-pret.etape-4::after { width: 75%; }
.etapes-pret li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--discret); }
.etapes-pret li::before { content: ""; width: 17px; height: 17px; border-radius: 9px; box-sizing: border-box; border: 2px solid var(--bordure-forte); background: var(--surface); }
.etapes-pret li.faite::before { border: 0; background: var(--couleur-etape) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5 9-10' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
[data-theme="veillee"] .etapes-pret li.faite::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5 9-10' fill='none' stroke='%2311181F' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.etapes-pret li[aria-current="step"] { color: var(--encre); font-weight: 700; }
.etapes-pret li[aria-current="step"]::before { border: 4px solid var(--couleur-etape); box-shadow: 0 0 0 4px var(--doux-etape); }

.filtres-ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.filtres { display: flex; gap: 2px; padding: 4px; background: var(--creux); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtres a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 999px; color: var(--discret); text-decoration: none; white-space: nowrap; }
.filtres a:hover { color: var(--encre); }
.filtres a[aria-current="true"] { background: var(--surface); color: var(--encre); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }
[data-theme="marelle"] .filtres { background: none; padding: 0 0 6px; gap: 10px; flex-wrap: wrap; overflow: visible; }
[data-theme="marelle"] .filtres a { min-height: 48px; padding: 0 20px; background: var(--surface); color: var(--encre); box-shadow: var(--ombre-carte); }
[data-theme="marelle"] .filtres a[aria-current="true"] { background: var(--accent); color: var(--sur-accent); box-shadow: 0 4px 0 var(--accent-fonce); }
.choix-etagere { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.filtres-ligne > * { min-width: 0; }
.contenu > .filtres, .contenu > .defile { align-self: flex-start; }
/* Conteneurs qui défilent : ils contiennent aussi les textes cachés (lecteurs d'écran),
   placés en absolu, qui sinon élargiraient la page. */
.filtres, .choix-etagere, .sous-menu { position: relative; }
/* Rangée qui défile (cadre posé par app.js) : fondu et flèche quand il en reste à droite. */
.defile { position: relative; min-width: 0; max-width: 100%; --fondu: var(--fond); }
.defile-filtres { --fondu: var(--creux); }
.defile.reste::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 72px; pointer-events: none; border-radius: 0 999px 999px 0; background: linear-gradient(90deg, transparent, var(--fondu) 60%); }
.defile-suite { display: none; position: absolute; z-index: 1; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 17px; background: var(--surface); color: var(--encre); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); align-items: center; justify-content: center; cursor: pointer; }
.defile.reste .defile-suite { display: inline-flex; }
.choix-etagere > span { color: var(--discret); font-size: 14px; }
.choix-etagere a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--bordure-forte); color: var(--encre); text-decoration: none; font-weight: 400; }
.choix-etagere a.initiale { padding: 0; border: 0; color: #FFFFFF; font-weight: 700; }
.choix-etagere a[aria-current="true"] { background: var(--sombre); border-color: var(--sombre); color: var(--sur-sombre); font-weight: 700; }
.choix-etagere a.initiale[aria-current="true"] { box-shadow: 0 0 0 3px var(--fond), 0 0 0 5px var(--encre); }

/* L'étagère : couvertures posées sur une planche, rangée par rangée (la planche est dessinée
   sous chaque couverture et se rejoint d'une colonne à l'autre). Statut en pastille sur la
   couverture, initiale du propriétaire en coin ; titre et auteur sous la planche. */
.rayon { --espace: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 30px var(--espace); padding: 0 12px; }
.livre { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--encre); text-decoration: none; }
.livre:hover { color: var(--encre); }
.livre:hover .couverture { transform: translateY(-3px); }
.pose { position: relative; padding-bottom: 14px; }
.pose::after { content: ""; position: absolute; left: calc(var(--espace) / -2 - 1px); right: calc(var(--espace) / -2 - 1px); bottom: 0; height: 12px; border-radius: 3px; background: var(--planche); box-shadow: 0 6px 10px -6px rgba(0, 0, 0, .35), inset 0 -3px 0 var(--planche-ombre); }
.couverture { position: relative; aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; overflow: hidden; box-shadow: var(--ombre-couverture); transition: transform .15s ease; }
.couverture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.couverture .typo { height: 100%; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; color: #FFFFFF; }
.couverture.avec-pastille .typo { padding-bottom: 36px; }
.couverture .typo strong { font-family: var(--titre); font-size: 17px; font-weight: var(--graisse-titre); line-height: 1.1; overflow-wrap: break-word; hyphens: auto; }
[data-theme="veillee"] .couverture .typo strong { font-size: 20px; }
.couverture .typo span { font-size: 12px; opacity: .92; }
.couverture .typo-haut { display: flex; flex-direction: column; gap: 4px; }
.couverture.avec-pastille .typo-haut { padding-right: 24px; }
.couverture .typo em { font-style: normal; font-size: 11px; font-weight: 700; opacity: .92; }
.couverture.pile { overflow: visible; box-shadow: 6px -6px 0 0 var(--bordure-forte), 12px -12px 0 0 var(--bordure), var(--ombre-couverture); }
.couverture.pile > img, .couverture.pile > .typo { border-radius: 3px 6px 6px 3px; }
.sur-couverture { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end; pointer-events: none; }
.sur-couverture .badge { max-width: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.coin-proprio { position: absolute; top: 8px; right: 8px; display: inline-flex; }
.coin-proprio .initiale { width: 22px; height: 22px; font-size: 11px; box-shadow: 0 0 0 2px #FFFFFF; }
.coin-proprio .initiale + .initiale { margin-left: -8px; }
.livre .titre { font-weight: 700; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.livre .auteur { font-size: 13px; color: var(--discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.livre .proprio { font-size: 12px; color: var(--discret); }
.serie-ligne { font-size: 12px; font-weight: 700; color: var(--accent); }
[data-theme="veillee"] .serie-ligne { color: var(--lien); }
/* Livre emprunté parmi les nôtres : liseré violet autour de la couverture. */
.livre.emprunte .couverture { box-shadow: 0 0 0 3px var(--fond), 0 0 0 5px var(--emprunt); }
/* Marelle : une carte par livre, sans planche. */
[data-theme="marelle"] .rayon { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; padding: 0; }
[data-theme="marelle"] .barre { border-bottom: 0; min-height: 84px; }
[data-theme="marelle"] .barre-liens { align-self: center; gap: 10px; }
[data-theme="marelle"] .barre-liens a { min-height: 52px; padding: 0 22px; border-radius: 26px; background: var(--surface); color: var(--encre); font-family: var(--titre); font-size: 18px; font-weight: 600; box-shadow: 0 3px 0 var(--bordure); }
[data-theme="marelle"] .barre-liens a[aria-current="page"] { background: var(--sombre); color: var(--sur-sombre); box-shadow: none; }
[data-theme="marelle"] .avatar { width: 52px; height: 52px; font-size: 22px; box-shadow: 0 0 0 4px #FFFFFF; }
[data-theme="marelle"] .livre { padding: 12px; background: var(--surface); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); }
[data-theme="marelle"] .pose { padding-bottom: 0; }
[data-theme="marelle"] .pose::after { display: none; }
[data-theme="marelle"] .couverture { border-radius: 16px; box-shadow: none; }
[data-theme="marelle"] .couverture.pile > img, [data-theme="marelle"] .couverture.pile > .typo { border-radius: 16px; }
[data-theme="marelle"] .couverture .typo strong { font-size: 20px; }
[data-theme="marelle"] .sur-couverture { top: 10px; bottom: auto; left: 10px; }
[data-theme="marelle"] .sur-couverture .badge { background: #FFFFFF; font-size: 13px; padding: 4px 10px; }
[data-theme="marelle"] .sur-couverture .badge.serie { background: var(--sombre); color: var(--sur-sombre); }
[data-theme="marelle"] .sur-couverture { right: 36px; }
[data-theme="marelle"] .couverture.avec-pastille .typo { padding: 44px 14px 14px; justify-content: flex-end; }
[data-theme="marelle"] .livre .titre { font-size: 16px; }
@media (max-width: 760px) {
  .rayon { --espace: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px var(--espace); padding: 0 6px; }
  .couverture .typo { padding: 8px; }
  .couverture.avec-pastille .typo { padding-bottom: 30px; }
  .couverture .typo strong { font-size: 14px; }
  .couverture .typo span { font-size: 10px; }
  .sur-couverture { left: 5px; right: 5px; bottom: 5px; }
  .sur-couverture .badge { font-size: 10px; padding: 1px 6px; }
  .coin-proprio { top: 5px; right: 5px; }
  .coeur-couverture { top: 5px; left: 5px; width: 22px; height: 22px; }
  .coin-proprio .initiale { width: 18px; height: 18px; font-size: 10px; }
  .livre .titre { font-size: 13px; }
  .livre .auteur { font-size: 12px; }
  [data-theme="marelle"] .rayon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  [data-theme="marelle"] .livre { padding: 8px; }
  [data-theme="marelle"] .filtres a { min-height: 44px; padding: 0 16px; }
  .cartes-a-traiter { grid-template-columns: 1fr; gap: 10px; }
  .carte-traiter { padding: 12px; }
  .mini-couverture { flex-basis: 40px; height: 60px; }
  .a-traiter.reduit { border-radius: var(--rayon-carte); padding: 8px 8px 8px 14px; flex-wrap: wrap; }
  .a-traiter-resume { flex: 1 1 100%; font-size: 14px; }
  .accueil { align-items: center; }
  .accueil-texte { flex: 1 1 180px; }
  .couverture.avec-pastille .typo-haut { padding-right: 0; padding-top: 18px; }
  .cartes-a-traiter .etapes-pret, .cartes-a-traiter .mot-court { display: none; }
  .choix-etagere { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding: 4px 2px; }
  .choix-etagere a { flex: 0 0 auto; }
  .accueil-texte p { font-size: 14px; }
  .anneau-objectif { padding: 0; border: 0; background: none; box-shadow: none; }
  .anneau-objectif > span { display: none; }
  .anneau { width: 56px; height: 56px; }
  .seulement-telephone { display: flex; }
}
@media (min-width: 761px) and (max-width: 1100px) { .cartes-a-traiter { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Fiche d'une œuvre -------------------------------------------------------------------- */
.fil a { color: var(--discret); }
.fiche-colonnes { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "lecture cote" "avis cote"; align-items: start; gap: 28px; }
.fiche-colonnes > .principal { grid-area: lecture; }
.fiche-colonnes > .lateral { grid-area: cote; }
.fiche-avis { grid-area: avis; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) { .fiche-colonnes { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lecture" "cote" "avis"; } }
.fiche-tete { display: flex; flex-wrap: wrap; gap: 36px; align-items: flex-start; }
.fiche-tete .fiche-couverture { flex: 0 0 210px; }
.fiche-tete .fiche-infos { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fiche-auteurs { margin: 0; font-size: 18px; }
.note-moyenne { margin: 0; }
.coeurs-des-autres { margin: 6px 0 0; }
.coeurs-des-autres .pastille-coeur { font-size: 13px; padding: 3px 10px; }
.note-moyenne strong { font-family: var(--titre); font-size: 30px; color: var(--accent); }
.avis-tete { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.avis-rubrique { font-family: var(--texte); font-size: 13px; font-weight: 700; color: var(--ok-texte); margin: 0; }
.avis-rubrique.moins { color: var(--danger-texte); }
.avis-texte { margin: 4px 0 0; }
.exemplaire strong { font-size: 14px; }
.titre-et-badge { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.resume-lecture { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.pastille-visibilite { font-size: 13px; color: var(--accent); background: var(--accent-doux); padding: 3px 10px; border-radius: 999px; }
[data-theme="veillee"] .pastille-visibilite { color: var(--lien); }
.section-titre { font-size: 22px; }
.plus-actions > summary { list-style: none; font-weight: 700; color: var(--lien); gap: 6px; }
.plus-actions > summary::-webkit-details-marker { display: none; }
.plus-actions > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); margin-left: 4px; }
.plus-actions[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.plus-actions[open] > .depliant-contenu { padding: 16px; border: 1px solid var(--bordure); border-radius: var(--rayon-carte); background: var(--surface-douce); }
/* Quatrième de couverture (lot du 18/10/2026) : sous les informations, à droite de la
   couverture ; sur téléphone, sous la couverture, sur toute la largeur. */
.fiche-tete.avec-resume { display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 16px 36px; }
.fiche-tete.avec-resume .fiche-couverture { grid-row: 1 / span 2; }
.fiche-resume { gap: 8px; max-width: 760px; align-self: start; }
.fiche-resume .petit-titre { font-family: var(--texte); font-size: 14px; font-weight: 700; color: var(--discret); margin: 0; }
.resume-texte p { margin: 0 0 8px; }
.resume-texte > p:last-of-type, .resume-reste p:last-child { margin-bottom: 0; }
.resume-reste { display: none; margin-top: 8px; }
.resume-texte:has(> .resume-suite[open]) .resume-reste { display: block; }
.resume-suite { margin-top: 6px; }
.resume-suite > summary { list-style: none; display: inline-flex; align-items: center; min-height: 32px; font-weight: 700; color: var(--lien); cursor: pointer; }
.resume-suite > summary::-webkit-details-marker { display: none; }
.resume-suite .si-ouvert, .resume-suite[open] .si-ferme { display: none; }
.resume-suite[open] .si-ouvert { display: inline; }
@supports not selector(:has(*)) {
  .resume-reste { display: block; }
  .resume-suite { display: none; }
}
.resume-source { font-size: 13px; color: var(--discret); }
.scan-resume { font-size: 14px; color: var(--discret); }
.deja-lu { display: flex; flex-direction: column; gap: 4px; }
/* Historique des prêts : tableau sur ordinateur, fiches empilées sur téléphone. */
.table-historique { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-historique th { text-align: left; font-size: 13px; font-weight: 700; color: var(--discret); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--bordure); }
.table-historique td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.table-historique tr:last-child td { border-bottom: 0; }
.table-historique .h-livre a { display: block; }
.table-historique .h-livre .sous-titre { display: block; font-size: 13px; }
.table-historique .h-date, .table-historique .h-duree { white-space: nowrap; }
.seul-mobile { display: none; }
.pagination { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.liste-historique li { display: block; }
.liste-historique .sous-titre { display: block; }
@media (max-width: 700px) {
  .table-historique thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table-historique, .table-historique tbody, .table-historique tr { display: block; }
  .table-historique tr { padding: 12px 0; border-bottom: 1px solid var(--bordure); }
  .table-historique tr:last-child { border-bottom: 0; }
  .table-historique td { display: block; padding: 0; border: 0; }
  .table-historique td.h-avec, .table-historique td.h-detail { color: var(--encre); }
  .table-historique td.h-detail:empty { display: none; }
  .table-historique td.h-date, .table-historique td.h-duree { display: inline; color: var(--discret); white-space: normal; }
  .table-historique td.h-livre { margin-bottom: 2px; }
  .seul-mobile { display: inline; }
}
@media (max-width: 520px) {
  .fiche-tete { flex-wrap: nowrap; gap: 16px; }
  .fiche-tete .fiche-couverture { flex: 0 0 104px; }
  .fiche-tete.avec-resume { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; }
  .fiche-tete.avec-resume .fiche-couverture { grid-row: auto; }
  .fiche-tete.avec-resume .fiche-resume { grid-column: 1 / -1; }
  .fiche-tete .fiche-couverture .couverture .typo { padding: 9px 8px; }
  .fiche-tete .fiche-couverture .couverture .typo strong { font-size: 14px; }
  .fiche-tete .fiche-couverture .couverture .typo span { font-size: 10px; }
  .fiche-tete .fiche-infos { flex: 1 1 auto; gap: 6px; }
  .fiche-tete h1 { font-size: 28px; overflow-wrap: anywhere; }
  .fiche-auteurs { font-size: 16px; }
  .note-moyenne strong { font-size: 24px; }
}

/* Mon compte, pages d'allauth */
.colonne-etroite { max-width: 680px; width: 100%; display: flex; flex-direction: column; gap: 20px; }
.etat { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.etat.oui { background: var(--ok-doux); color: var(--ok-texte); }
.etat.non { background: var(--neutre-doux); color: var(--neutre-texte); }
.etat.attention { background: var(--attente-doux); color: var(--attente-texte); }
.etat.alerte { background: var(--danger-doux); color: var(--danger-texte); }
.etat.soi { background: var(--accent-doux); color: var(--encre); }
.qr { display: flex; justify-content: center; padding: 8px; background: #FFFFFF; border: 1px solid var(--bordure); border-radius: var(--rayon); }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; letter-spacing: .04em; word-break: break-all; }
.codes { columns: 2; font-family: ui-monospace, Consolas, monospace; font-size: 15px; padding-left: 20px; }
.champ ul.errorlist, ul.errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger-texte); font-size: 14px; }
.champ .helptext, .champ .aide, form.pile .helptext { font-size: 13px; color: var(--discret); }
form.pile .helptext { order: 3; }
form.pile > div > label { order: 1; }
form.pile > div > input, form.pile > div > select, form.pile > div > textarea { order: 2; }
form.pile > div > ul.errorlist { order: 4; }
.case-memoire { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 400; }
form.pile { display: flex; flex-direction: column; gap: 14px; }
form.pile > div { display: flex; flex-direction: column; gap: 6px; }
form.pile > div:has(> input[type=checkbox]) { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
form.pile ul[id] { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
form.pile ul[id] label { font-weight: 400; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.colonne-etroite img[src^="data:"] { width: 220px; height: auto; align-self: center; background: #FFFFFF; padding: 8px; border-radius: var(--rayon); }
.colonne-etroite .carte .carte { border: 0; border-top: 1px solid var(--bordure); border-radius: 0; padding: 16px 0 0; background: none; box-shadow: none; }
.colonne-etroite form.pile .boutons { justify-content: flex-start; }
.bandeau { background: var(--accent-doux); color: var(--encre); border-radius: var(--rayon); padding: 12px 16px; font-size: 14px; }
.grille-reglages { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.jauge { display: flex; flex-direction: column; gap: 6px; }
.jauge .valeur { font-family: var(--titre); font-size: 26px; font-weight: var(--graisse-titre); line-height: 1; }
.jauge .valeur small { font-family: var(--texte); font-size: 14px; color: var(--discret); font-weight: 400; }
.source { display: flex; flex-direction: column; gap: 8px; }
.source h3 { font-size: 20px; }
.etapes { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.etapes li { flex: 1; height: 6px; border-radius: 3px; background: var(--creux); }
.etapes li[aria-current="step"], .etapes li.faite { background: var(--accent); }

/* Moi : identité, choix de l'apparence, liens */
.identite-tete { display: flex; align-items: center; gap: 16px; min-width: 0; }
.initiale.grande { width: 60px; height: 60px; font-size: 27px; }
.identite-prenom { font-family: var(--titre); font-size: 30px; line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.pastilles-identite { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pastilles-identite li { display: inline-flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; max-width: 100%; padding: 5px 12px; border-radius: 16px; background: var(--creux); border: 1px solid var(--bordure); font-size: 14px; line-height: 1.35; color: var(--encre); }
.pastilles-identite .pastille-cle { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--discret); }
.pastilles-identite .pastille-valeur { min-width: 0; overflow-wrap: anywhere; }
.pastilles-identite .pastille-role { background: var(--vif); border-color: var(--vif); color: var(--sur-vif); font-weight: 700; }
.formulaire-apparence { display: flex; flex-direction: column; gap: 12px; }
.formulaire-apparence .groupe-choix legend { font-family: var(--titre); font-size: 22px; font-weight: var(--graisse-titre); }
.themes { display: flex; flex-direction: column; gap: 10px; }
.choix-theme { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); font-weight: 400; cursor: pointer; }
.choix-theme input { flex: 0 0 20px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.choix-theme-texte { display: flex; flex-direction: column; }
.choix-theme-texte > span { font-size: 13px; color: var(--discret); }
.choix-theme-texte strong { font-size: 16px; }
.nom-rayonnage { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 800; }
.nom-veillee { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 20px; }
.nom-marelle { font-family: "Fredoka", system-ui, sans-serif; font-weight: 600; font-size: 18px; }
.apercu-theme { flex: 0 0 64px; height: 44px; display: flex; align-items: flex-end; gap: 3px; padding: 6px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .1); }
.apercu-theme i { flex: 1; border-radius: 2px; }
.apercu-theme i:nth-child(1) { height: 26px; } .apercu-theme i:nth-child(2) { height: 20px; } .apercu-theme i:nth-child(3) { height: 30px; }
.apercu-rayonnage { background: #F6F6F2; }
.apercu-rayonnage i:nth-child(1) { background: #1F3FCC; } .apercu-rayonnage i:nth-child(2) { background: #FF6B3D; } .apercu-rayonnage i:nth-child(3) { background: #16181D; }
.apercu-veillee { background: #11181F; border-color: #2A3A48; }
.apercu-veillee i:nth-child(1) { background: #F5B942; } .apercu-veillee i:nth-child(2) { background: #C7B8FF; } .apercu-veillee i:nth-child(3) { background: #2BB3AA; }
.apercu-marelle { background: #E9F5FF; border-radius: 12px; }
.apercu-marelle i { border-radius: 6px; }
.apercu-marelle i:nth-child(1) { background: #FF8A3D; } .apercu-marelle i:nth-child(2) { background: #1E9E5A; } .apercu-marelle i:nth-child(3) { background: #1D5FD1; }
@supports selector(:has(*)) {
  .choix-theme:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-doux); padding: 9px 11px; }
  .choix-theme:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
}
.liste-liens { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); overflow: hidden; box-shadow: var(--ombre-carte); }
[data-theme="marelle"] .liste-liens { border-color: transparent; }
.liste-liens a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 16px; color: var(--encre); text-decoration: none; border-top: 1px solid var(--bordure-legere); }
.liste-liens a:first-child { border-top: 0; }
.liste-liens a:hover { background: var(--surface-douce); color: var(--encre); }
.liste-liens a > span { display: flex; flex-direction: column; }
.liste-liens small { color: var(--discret); }
.liste-liens svg { flex: 0 0 auto; color: var(--pale); }

/* Mon défi (enfant) : un chemin, une case par livre, le drapeau à l'arrivée. */
.defi { gap: 18px; }
.chemin { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 12px 10px; margin: 0; padding: 0; list-style: none; }
.case-defi { height: 58px; display: flex; align-items: center; justify-content: center; border-radius: 18px; font-family: var(--titre); font-size: 22px; font-weight: var(--graisse-titre); background: var(--neutre-doux); color: var(--pale); }
.case-defi.faite { background: var(--ok); color: #FFFFFF; }
[data-theme="veillee"] .case-defi.faite { color: #0C1217; }
.case-defi.prochaine { border: 3px dashed var(--vif); background: var(--cours-doux); color: var(--cours-texte); }
.case-defi.arrivee { background: #FFE07A; color: #5C4300; }
.case-defi.arrivee.faite { background: var(--ok); color: #FFFFFF; }

/* --- Séries ------------------------------------------------------------------------------- */
.numero-tome { font-family: var(--titre); font-size: 18px; font-weight: var(--graisse-titre); }
.pile-sobre { display: flex; flex-direction: column; gap: 6px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 28px 20px; }

/* Photo de couverture (fiche d'un livre) */
.photo-couverture { display: flex; flex-direction: column; gap: 10px; }
.photo-couverture[open] { gap: 12px; }
.photo-couverture:not([open]) { gap: 0; }
.photo-couverture > summary.bouton { list-style: none; display: inline-flex; align-self: flex-start; }
.photo-couverture > summary.bouton::-webkit-details-marker { display: none; }
.photo-couverture input[type="file"] { font: inherit; max-width: 100%; }

/* Volets dépliables (actions de Mon foyer, de Proches, de la fiche) */
.depliant-action { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.depliant-action > summary.bouton { list-style: none; display: inline-flex; align-self: flex-end; }
.depliant-action > summary.bouton::-webkit-details-marker { display: none; }
.depliant-action[open] { padding: 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-douce); }

/* Étagères (onglets par personne, page d'un foyer lié) */
.etageres { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--bordure); }
.etagere { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: var(--discret); text-decoration: none; font-weight: 400; }
.etagere:hover { color: var(--encre); }
.etagere[aria-current="true"] { color: var(--encre); border-bottom-color: var(--accent); font-weight: 700; }
.initiale { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #FFFFFF; font-family: var(--texte); font-size: 18px; font-weight: 700; line-height: 1; }
.initiale.petite { width: 24px; height: 24px; font-size: 13px; }
.livre .proprios { display: inline-flex; align-items: center; gap: 6px; }
.livre .proprios .initiale.petite { width: 20px; height: 20px; font-size: 11px; box-shadow: 0 0 0 2px var(--fond); }
.livre .proprios .initiale.petite + .initiale.petite { margin-left: -10px; }
.initiale.commun { background: var(--neutre-doux); color: var(--neutre-texte); }

/* --- Mon foyer ---------------------------------------------------------------------------- */
.membres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.membre { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 8px; align-items: center; padding: 14px 0; border-top: 1px solid var(--bordure-legere); scroll-margin-top: 80px; }
.membre:first-child { border-top: 0; padding-top: 4px; }
.membre-infos { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.nom-ligne { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.etagere-lien { font-size: 14px; white-space: nowrap; }
.membre-action { grid-column: 2 / -1; }
.membre-action > summary.bouton { list-style: none; display: inline-flex; }
.membre-action > summary.bouton::-webkit-details-marker { display: none; }
.membre-action[open] > .depliant-contenu { padding: 14px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-douce); }
.pile-formulaire { display: flex; flex-direction: column; gap: 14px; }
.mode-connexion { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mode-connexion legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 4px; }
.choix-connexion { display: flex; flex-direction: column; gap: 0; }
.choix-connexion .case { min-height: 40px; align-items: flex-start; padding-top: 8px; }
.choix-connexion .case input { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; }
.champs-connexion { display: flex; flex-direction: column; gap: 14px; }
.consentement { font-size: 13px; color: var(--discret); padding: 10px 12px; border-left: 3px solid var(--vif); background: var(--attente-fond); border-radius: 0 8px 8px 0; }
@supports selector(:has(*)) {
  .formulaire-enfant:has(input[value="aucune"]:checked) .si-connexion { display: none; }
}
@media (max-width: 520px) {
  .membre { grid-template-columns: 40px minmax(0, 1fr); }
  .etagere-lien { grid-column: 2; }
  .membre .boutons { grid-column: 2; }
}
.ligne-formulaire { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ligne-formulaire .champ { flex: 1 1 220px; }
.ligne-formulaire.depliant-contenu { flex-direction: row; }
.champ.code input, .code-fige, .avec-suffixe input, .avec-suffixe .suffixe, .identifiant { font-family: ui-monospace, Consolas, monospace; }
.code-fige { font-size: 18px; }
.identifiant { color: var(--encre); background: var(--creux); padding: 1px 6px; border-radius: 6px; }
.avec-suffixe { display: flex; align-items: stretch; border: 1px solid var(--bordure-forte); border-radius: var(--rayon); overflow: hidden; background: var(--surface); }
.avec-suffixe:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.avec-suffixe input { flex: 1 1 0; width: 0; min-width: 0; border: 0; border-radius: 0; }
.avec-suffixe input:focus-visible { outline: none; }
.avec-suffixe .suffixe { flex: 0 0 auto; display: flex; align-items: center; padding: 0 12px; background: var(--creux); color: var(--discret); white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.sous-section { font-family: var(--texte); font-size: 14px; font-weight: 700; color: var(--discret); margin: 8px 0 0; }
.initiale.attente { background: var(--creux); color: var(--discret); border: 2px dashed var(--bordure-forte); }
.membre .boutons form { margin: 0; }
.membre-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.membre-actions > .membre-action { grid-column: auto; margin: 0; }
.membre-actions > details[open] { flex: 1 1 100%; }
.membre-action.suppression[open] > .depliant-contenu { border-color: var(--danger-bord); background: var(--danger-doux); }
/* Rôle d'administrateur (25/10/2026) : « seul administrateur » sous la ligne. */
.membre-note { grid-column: 2 / -1; }
.liste-effets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.choix-livres { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; min-width: 0; }
.choix-livres legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 2px; }
.apparence-enfant .themes { flex-direction: row; flex-wrap: wrap; }
.apparence-enfant .choix-theme { flex: 1 1 200px; min-width: 0; flex-wrap: wrap; }
.apparence-enfant legend { font-family: var(--texte); font-size: 14px; }

/* --- Fiche de lecture --------------------------------------------------------------------- */
.deux-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
textarea.texte-libre { font-family: var(--texte); font-size: 15px; min-height: 104px; resize: vertical; }
.formulaire-lecture { display: flex; flex-direction: column; gap: 18px; }
.groupe-choix { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.groupe-choix legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--creux); border-radius: var(--rayon); }
@media (max-width: 520px) { .segments { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.segment { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 10px; border-radius: calc(var(--rayon) - 3px); font-size: 15px; font-weight: 400; cursor: pointer; text-align: center; color: var(--discret); }
.segment input, .option input, .sans-note input { accent-color: var(--accent); }
.segments.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .segments.trois { grid-template-columns: 1fr; } }
.options { display: flex; flex-direction: column; gap: 6px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); font-weight: 400; font-size: 15px; cursor: pointer; }
.option input { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; }
.option-texte { display: flex; flex-direction: column; }
.option-texte strong { font-weight: 700; }
.etoiles-saisie { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.etoiles-saisie input[type=radio] { width: 18px; height: 18px; }
.demi-etoile { display: inline-flex; align-items: center; width: 22px; height: 44px; color: var(--bordure-forte); cursor: pointer; }
.demi-etoile.gauche { justify-content: flex-end; }
.demi-etoile.droite { justify-content: flex-start; margin-right: 4px; }
.demi-etoile svg { fill: currentColor; }
.sans-note { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: 10px; font-size: 14px; font-weight: 400; color: var(--discret); cursor: pointer; }
.libelle-aime { color: var(--ok-texte); }
.libelle-moins { color: var(--danger-texte); }
.formulaire-ajout .libelle-ajout-envies, .formulaire-ajout .libelle-ajout-lu { display: none; }
@supports selector(:has(*)) {
  .segment input, .etoiles-saisie input[type=radio], .option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
  .segment:has(input:checked) { background: var(--surface); color: var(--encre); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
  [data-theme="marelle"] .segment:has(input:checked) { background: var(--accent); color: var(--sur-accent); }
  .segment:has(input:focus-visible), .option:has(input:focus-visible), .sans-note:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
  .etoiles-saisie input:focus-visible + .demi-etoile { outline: 3px solid var(--focus); border-radius: 6px; }
  .option:has(input:checked) { border: 2px solid var(--accent); background: var(--accent-doux); padding: 9px 11px; }
  /* Page Ajouter, « Ce livre, je… » (lot « Envies et avis ») : l'étagère ne sert qu'à la
     bibliothèque ; le bouton dit ce qu'il fait. Sans :has(), tout reste affiché. */
  .formulaire-ajout:has(input[name="destination"]:not([value="bibliotheque"]):checked) .seulement-bibliotheque { display: none; }
  .formulaire-ajout:has(input[name="destination"][value="envies"]:checked) .libelle-ajout-defaut,
  .formulaire-ajout:has(input[name="destination"][value="lu"]:checked) .libelle-ajout-defaut { display: none; }
  .formulaire-ajout:has(input[name="destination"][value="envies"]:checked) .libelle-ajout-envies,
  .formulaire-ajout:has(input[name="destination"][value="lu"]:checked) .libelle-ajout-lu { display: inline; }
  .sans-note:has(input:checked) { color: var(--encre); font-weight: 700; text-decoration: underline; }
  .etoiles-saisie:has(input[value="0.5"]:checked) .demi-etoile:nth-of-type(-n+1),
  .etoiles-saisie:has(input[value="1.0"]:checked) .demi-etoile:nth-of-type(-n+2),
  .etoiles-saisie:has(input[value="1.5"]:checked) .demi-etoile:nth-of-type(-n+3),
  .etoiles-saisie:has(input[value="2.0"]:checked) .demi-etoile:nth-of-type(-n+4),
  .etoiles-saisie:has(input[value="2.5"]:checked) .demi-etoile:nth-of-type(-n+5),
  .etoiles-saisie:has(input[value="3.0"]:checked) .demi-etoile:nth-of-type(-n+6),
  .etoiles-saisie:has(input[value="3.5"]:checked) .demi-etoile:nth-of-type(-n+7),
  .etoiles-saisie:has(input[value="4.0"]:checked) .demi-etoile:nth-of-type(-n+8),
  .etoiles-saisie:has(input[value="4.5"]:checked) .demi-etoile:nth-of-type(-n+9),
  .etoiles-saisie:has(input[value="5.0"]:checked) .demi-etoile:nth-of-type(-n+10) { color: var(--etoile); }
  .formulaire-lecture:not(:has(input[name="statut"][value="lu"]:checked)) .si-lu { display: none; }
}
.depliant-lecture > summary.bouton, .depliant-retrait > summary.bouton, .depliant-objectif > summary.bouton { list-style: none; display: inline-flex; }
.depliant-lecture > summary.bouton::-webkit-details-marker, .depliant-retrait > summary.bouton::-webkit-details-marker, .depliant-objectif > summary.bouton::-webkit-details-marker { display: none; }
.depliant-retrait[open] > .depliant-contenu { padding: 12px; border: 1px solid var(--danger-bord); border-radius: var(--rayon); background: var(--danger-doux); }
.fiches-enfants { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fiche-enfant { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--bordure-legere); }
.fiche-enfant:first-child { border-top: 0; padding-top: 0; }
.fiche-enfant-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fiche-enfant .depliant-lecture[open] > .depliant-contenu { padding: 14px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-douce); }

/* Objectif de lecture : Mon foyer */
.objectif { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.objectif-chiffres { display: flex; flex-direction: column; gap: 2px; }
.objectif-titre { font-family: var(--texte); font-size: 13px; font-weight: 700; color: var(--discret); }
.objectif-nombre { margin: 0; font-family: var(--titre); font-size: 36px; font-weight: var(--graisse-titre); line-height: 1; }
.objectif-nombre strong { color: var(--accent); }
.objectif-nombre span { font-size: 22px; color: var(--discret); }
.objectif-jauge { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.depliant-objectif { flex: 1 1 100%; }
.depliant-objectif:not([open]) { flex: 0 0 auto; }
.avec-unite { display: flex; align-items: center; gap: 10px; }
input.court { width: 110px; }
.objectifs-foyer { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.objectif-membre { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(120px, 220px) auto; column-gap: 14px; row-gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--bordure-legere); }
.objectif-membre:first-child { border-top: 0; padding-top: 4px; }
.objectif-membre .nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.objectif-membre .depliant-objectif { grid-column: 2 / -1; }
.objectif-membre .depliant-objectif[open] > .depliant-contenu { padding: 14px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-douce); }
@media (max-width: 520px) {
  .objectif-membre { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .objectif-membre progress, .objectif-membre .jauge-vide { grid-column: 2 / -1; }
  .objectif-membre .nombre { grid-column: 2; text-align: left; }
}

/* --- Scan (page /scanner/) ---------------------------------------------------------------- */
.scan { display: flex; flex-direction: column; gap: 14px; max-width: 560px; width: 100%; margin: 0 auto; }
.scan-tete { display: flex; flex-direction: column; gap: 12px; }
.scan-modes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--rayon); background: var(--creux); }
.scan-modes a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 0 6px; border-radius: calc(var(--rayon) - 3px); color: var(--discret); text-decoration: none; font-size: 14px; }
.scan-modes a[aria-current="page"] { background: var(--sombre); color: var(--sur-sombre); font-weight: 700; }
.scan-camera { position: relative; aspect-ratio: 4 / 3; border-radius: var(--rayon-carte); overflow: hidden; background: #0E1114; display: flex; align-items: center; justify-content: center; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-cadre { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border-radius: 14px; box-shadow: 0 0 0 999px rgba(14, 17, 20, .45); pointer-events: none; }
.scan-cadre span { position: absolute; width: 28px; height: 28px; border: 0 solid #FFFFFF; }
.scan-cadre span:nth-child(1) { left: -2px; top: -2px; border-left-width: 4px; border-top-width: 4px; border-top-left-radius: 14px; }
.scan-cadre span:nth-child(2) { right: -2px; top: -2px; border-right-width: 4px; border-top-width: 4px; border-top-right-radius: 14px; }
.scan-cadre span:nth-child(3) { left: -2px; bottom: -2px; border-left-width: 4px; border-bottom-width: 4px; border-bottom-left-radius: 14px; }
.scan-cadre span:nth-child(4) { right: -2px; bottom: -2px; border-right-width: 4px; border-bottom-width: 4px; border-bottom-right-radius: 14px; }
.scan-lu .scan-cadre span { border-color: #FF8A3D; }
.scan-etat { position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0; text-align: center; font-size: 13px; color: #FFFFFF; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.scan-lampe { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(14, 17, 20, .75); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.scan-lampe[hidden] { display: none; }
.scan-lampe[aria-pressed="true"] { background: #FF8A3D; color: #2B1100; }
.scan-relancer { position: relative; z-index: 1; }
.scan-relancer[hidden] { display: none; }
.scan-aide { margin: 0; text-align: center; }
.saisie-manuelle > summary { color: var(--lien); font-weight: 700; }
.scan-resultat:empty { display: none; }
.scan-fiche { gap: 14px; }
.scan-livre { display: flex; gap: 14px; align-items: flex-start; }
.scan-mini { flex: 0 0 72px; }
.scan-mini .couverture .typo { padding: 7px 6px; }
.scan-mini .couverture .typo strong { font-size: 11px; }
.scan-mini .couverture .typo span { font-size: 9px; }
.scan-livre-texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.scan-livre-texte .badge { border-radius: 10px; }
.scan-titre { font-family: var(--titre); font-size: 22px; font-weight: var(--graisse-titre); line-height: 1.1; }
.scan-boutons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.scan-boutons .bouton, .scan-boutons form, .scan-boutons form .bouton { width: 100%; min-height: 48px; padding: 6px 10px; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.scan-confirmation { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ok-texte); }
.rafale-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rafale-liste:empty { display: none; }
.rafale-ligne { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bordure-legere); }
.rafale-couverture { flex: 0 0 28px; height: 42px; border-radius: 3px; }
.rafale-couverture:not([class*="teinte-"]) { background: var(--creux); }
.rafale-ligne .badge { white-space: nowrap; }
.rafale-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.rafale-texte strong { font-size: 14px; font-weight: 700; }
.rafale-retirer { flex: 0 0 44px; width: 44px; height: 44px; border: 0; background: none; color: var(--discret); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--rayon); }
.rafale-retirer:hover { background: var(--creux); color: var(--encre); }
.scan-invitation { display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--accent); }
.scan-invitation[hidden] { display: none; }
.scan-invitation h2 { font-size: 22px; }

/* Ajouter un livre, importer, « Je l'ai déjà ? » : trois façons d'ajouter, un même sous-menu. */
.sous-menu { display: flex; gap: 2px; padding: 4px; background: var(--creux); border-radius: 999px; align-self: flex-start; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sous-menu a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; color: var(--discret); text-decoration: none; white-space: nowrap; }
.sous-menu a[aria-current="page"] { background: var(--surface); color: var(--encre); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .14); }

/* --- Proches : liens entre foyers, prêts, demandes ---------------------------------------- */
.titre-section { font-size: 30px; }
.pile-sections { display: flex; flex-direction: column; gap: 14px; }
.lien-foyer h3 { font-size: 22px; }
.sous-section-texte { font-weight: 700; }
.liste-actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.liste-actions > li { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--bordure-legere); }
.liste-actions > li:first-child { border-top: 0; padding-top: 0; }
.liste-actions > li > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; overflow-wrap: anywhere; }
.liste-actions > li > .boutons { align-items: flex-start; }
.liste-actions form { margin: 0; }
.liste-actions .etapes-pret { flex: 1 1 100%; max-width: 420px; }
.mot { font-size: 14px; font-style: italic; color: var(--encre); }
.encart-retard { border-radius: var(--rayon-carte); padding: 18px 20px; background: var(--retard-fond); border: 1px solid var(--retard-bord); display: flex; flex-direction: column; gap: 12px; color: var(--retard-texte); }
.encart-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.encart-tete h2 { font-size: 20px; color: inherit; }
.encart-tete a { margin-left: auto; }
.encart-retard .liste-actions > li { border-top-color: var(--retard-bord); }
.encart-retard a { color: var(--retard-texte); }
.encart-remettre { border-radius: var(--rayon-carte); padding: 18px 20px; background: var(--attente-fond); border: 1px solid var(--attente-bord); display: flex; flex-direction: column; gap: 12px; color: var(--encre); }
.encart-remettre .liste-actions > li { border-top-color: var(--attente-bord); }
.cercle-ligne { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--bordure-legere); }
.cercle-ligne:first-child { border-top: 0; padding-top: 0; }
.cercle-ligne > details { align-self: flex-start; }
.cercle-ligne > details[open] { align-self: stretch; }
.depliant-lien[open] > .depliant-contenu, .cercle-ligne details[open] > .depliant-contenu { padding: 14px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface-douce); }
.formulaire-reglage { display: flex; flex-direction: column; gap: 14px; }
@supports selector(:has(*)) {
  .formulaire-reglage:has(input[name$="cercle"][value="aucun"]:checked) .si-cercle { display: none; }
  .formulaire-reglage:not(:has(input[name$="cercle"][value="aucun"]:checked)):not(:has(input[name$="personnaliser"]:checked)) .si-sur-mesure { display: none; }
  .formulaire-accepter:not(:has(input[name="retour"][value="cercle"]:checked)) .si-cercle-retour { display: none; }
  .formulaire-accepter:not(:has(input[name="retour"][value="pretables"]:checked)):not(:has(input[name="retour"][value="tout"]:checked)) .si-reglages-retour { display: none; }
}
.copie { display: flex; gap: 8px; flex-wrap: wrap; }
.copie input { flex: 1 1 240px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.qr-lien { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-lien .qr { flex: 0 0 auto; }
.qr-lien > div:last-child { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.avertissement { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--rayon); background: var(--retard-fond); border: 1px solid var(--retard-bord); color: var(--retard-texte); }
.avertissement svg { flex: 0 0 auto; margin-top: 1px; }
.accepter-tete { display: flex; align-items: center; gap: 14px; }
.pastille-icone { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-doux); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.si-cercle-retour { padding: 4px 0 4px 30px; }
.actions-lien { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.actions-lien > details { margin: 0; }
.actions-lien > details[open] { flex: 1 1 100%; }

/* Fiche : prêter, file des demandes, demander à emprunter */
.bloc-pret { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--rayon); background: var(--surface-douce); border: 1px solid var(--bordure); }
.bloc-pret h3 { font-family: var(--texte); font-size: 15px; font-weight: 700; }
.file-demandes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.file-demandes > li { display: flex; flex-direction: column; gap: 6px; }
.formulaire-pret { display: flex; flex-direction: column; gap: 12px; }
.formulaire-pret .options { gap: 8px; }
/* Seul le champ du choix coché (liste des foyers liés ou nom libre) ; sans :has(), les deux
   restent affichés comme avant. */
.formulaire-pret .option:not(:has(input:checked)) + .champ { display: none; }
.deux-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.case-pretable { align-items: flex-start; }
.case-pretable input { margin-top: 2px; }
.case-pretable span { display: flex; flex-direction: column; }
.formulaire-demande textarea { font-family: var(--texte); font-size: 15px; min-height: 88px; }
.etat-demande { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--rayon); background: var(--attente-doux); color: var(--attente-texte); }
.etat-accord, .etat-refus { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--rayon); color: var(--encre); }
.etat-accord { background: var(--attente-fond); border: 1px solid var(--attente-bord); }
.etat-refus { background: var(--neutre-doux); }
.etat-accord .boutons, .etat-refus .boutons { margin: 0; }
.etat-accord form, .etat-refus form { margin: 0; }
.mot-bloc { margin: 0; padding: 8px 12px; border-radius: var(--rayon); background: var(--surface); font-size: 14px; overflow-wrap: anywhere; }
.depliant-reponse { margin: 0; }
.depliant-reponse > summary { list-style: none; }
.depliant-reponse > summary::-webkit-details-marker { display: none; }
.depliant-reponse[open] { flex: 1 1 100%; }
.depliant-reponse[open] > summary { margin-bottom: 8px; }
.formulaire-reponse { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.formulaire-reponse textarea { font-family: var(--texte); font-size: 15px; min-height: 64px; }
.sous-section-titre { font-family: var(--texte); font-size: 14px; font-weight: 700; color: var(--discret); margin-top: 6px; }

/* Très petits écrans (320 px) : deux couvertures par rangée, titres lisibles en entier. */
@media (max-width: 359px) {
  .rayon, [data-theme="marelle"] .rayon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Impression : seulement le contenu. */
@media print {
  .barre, .onglets, .evitement { display: none; }
  body { background: #FFFFFF; color: #000000; }
}

/* --- Centre de notifications (livraison 4) ------------------------------------------------- */
/* Cloche de la barre : un lien vers la page ; sur ordinateur, app.js ouvre un panneau. */
.cloche { position: relative; flex: 0 0 auto; }
.bouton-cloche { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 22px; color: var(--encre); text-decoration: none; }
.bouton-cloche:hover { background: var(--creux); color: var(--encre); }
.bouton-cloche[aria-current="page"], .cloche.ouverte .bouton-cloche { background: var(--accent-doux); color: var(--accent); }
.bouton-cloche .compteur { position: absolute; top: -2px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px; box-shadow: 0 0 0 2px var(--barre-fond); }
.compteur[hidden] { display: none; }
.panneau-notifications { position: absolute; right: -52px; top: calc(100% + 10px); z-index: 30; width: 440px; max-height: calc(100vh - 110px); overflow-y: auto; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); box-shadow: var(--ombre-menu); }
.panneau-notifications[hidden] { display: none; }
.panneau-tete { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; background: var(--surface); }
.panneau-tete form { margin: 0; }
.panneau-tete .lien-bouton { font-size: 14px; }
.panneau-tete h2 { font-size: 22px; }
.panneau-tete a { font-size: 14px; font-weight: 700; }
.panneau-pied { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--bordure-legere); background: var(--surface); }
.panneau-pied form { margin: 0; }
.panneau-pied .bouton { margin-left: auto; }
.panneau-chargement { margin: 0; padding: 18px; color: var(--discret); }
.notif-groupe { margin: 0; padding: 8px 18px 6px; font-family: var(--texte); font-size: 13px; font-weight: 700; letter-spacing: 0; color: var(--discret); }
.notif-section .notif-groupe { padding: 0 0 6px; }
.notif-liste { margin: 0; padding: 0; list-style: none; }
.notif-liste.carte-liste { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); overflow: hidden; box-shadow: var(--ombre-carte); }
.notif + .notif, .panneau-notifications .notif { border-top: 1px solid var(--bordure-legere); }
.notif form { margin: 0; }
.notif-bouton { display: flex; gap: 12px; width: 100%; padding: 12px 18px; border: 0; background: transparent; color: var(--encre); font: inherit; text-align: left; cursor: pointer; }
.notif-bouton:hover { background: var(--creux); }
.notif.non-lue .notif-bouton { background: var(--non-lu); }
.notif.non-lue .notif-bouton:hover { background: var(--creux); }
.notif-icone { flex: 0 0 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--neutre-doux); color: var(--neutre-texte); }
.famille-pret .notif-icone { background: var(--accent-doux); color: var(--accent); }
.famille-emprunt .notif-icone { background: var(--emprunt-doux); color: var(--emprunt-texte); }
.famille-lien .notif-icone { background: var(--ok-doux); color: var(--ok-texte); }
.famille-foyer .notif-icone { background: var(--ok-doux); color: var(--ok-texte); }
.notif-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.notif-citation { font-size: 14px; font-style: italic; color: var(--discret); }
.notif-meta { font-size: 13px; color: var(--discret); }
.notif-point { flex: 0 0 10px; height: 10px; margin-top: 6px; border-radius: 5px; background: var(--vif); }
.notif-vide { margin: 0; padding: 14px 18px; color: var(--discret); }
section.notif-vide { padding: 18px 20px; }
.notif-arrivees { margin: 0; padding: 12px 16px; border-radius: var(--rayon); background: var(--accent-doux); font-weight: 700; }
.notif-arrivees[hidden] { display: none; }
[data-theme="marelle"] .notif-icone { flex-basis: 40px; height: 40px; border-radius: 14px; }
@media (max-width: 760px) {
  .notif-bouton { padding: 12px 14px; }
}

/* Proches : colonne de droite pour le fil sur ordinateur ; sur téléphone, le fil suit les
   demandes reçues (ordre du document). */
.proches-grille { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 981px) {
  .proches-grille.avec-fil { display: grid; grid-template-columns: minmax(0, 1fr) 360px; column-gap: 28px; row-gap: 0; align-items: start; }
  .proches-grille.avec-fil > * { grid-column: 1; margin-bottom: 24px; }
  .proches-grille.avec-fil > .fil-proches { grid-column: 2; grid-row: 1 / span 20; margin-bottom: 0; }
}
.fil-proches { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); box-shadow: var(--ombre-carte); }
.fil-liste { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.fil-element { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--bordure-legere); }
.fil-meta { margin: 0; font-size: 13px; color: var(--discret); }
.fil-couvertures { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fil-couvertures a { display: flex; flex-direction: column; gap: 4px; color: var(--encre); text-decoration: none; font-size: 13px; }
.fil-couvertures .couverture { width: 100%; }
.fil-titre-livre { overflow-wrap: anywhere; line-height: 1.25; }
.fil-lien { font-weight: 700; }
.fil-rangee { display: flex; gap: 12px; align-items: flex-start; }
.fil-mini { flex: 0 0 44px; }
.fil-mini .couverture { width: 44px; }
/* Couvertures dessinées du fil : sans texte (le titre est écrit dessous, ou à côté). */
.fil-mini .couverture .typo > *, .fil-couvertures .couverture .typo > * { display: none; }
.fil-corps { min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.fil-corps .bouton { align-self: flex-start; margin-top: 4px; }
.fil-etoiles { display: inline-flex; gap: 2px; color: var(--etoile); font-size: 15px; }
.fil-vide { margin: 6px 0 0; color: var(--discret); }
.qui-marque-le-retour { display: block; font-size: 14px; color: var(--emprunt-texte); }

/* Notifications sur le téléphone (Moi › Notifications, proposition de la page Notifications ;
   maquette du 21/10/2026). */
.lien-retour { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; }
.reglages-push h1 { font-family: var(--titre); font-weight: var(--graisse-titre); letter-spacing: var(--espacement-titre); font-size: 32px; line-height: 1.05; }
.reglages-push .carte h2 { font-size: 18px; }
.reglages-push .carte h3 { font-size: 16px; }
.push-vue { display: flex; flex-direction: column; gap: 10px; }
.push-vue[hidden], [data-push-vue][hidden], .reglages-push .etat[hidden] { display: none; }
.push-activer { align-self: stretch; min-height: 48px; }
.push-etapes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.encart-bloque { background: var(--attente-doux); color: var(--attente-texte); border-radius: var(--rayon); padding: 14px 16px; }
.encart-bloque strong { color: inherit; }
/* Provenance de la couverture sur la fiche (BnF : source et date exigées). */
.couverture-source { font-size: 11px; line-height: 1.3; color: var(--neutre-texte); margin-top: 6px; text-align: center; }
.couverture-source abbr { text-decoration: none; }
/* Heures calmes en cours (recette du 22/10) : discret, tons neutres du thème. */
.note-calme { background: var(--neutre-doux); color: var(--neutre-texte); border-radius: var(--rayon); padding: 10px 14px; font-size: 14px; }
.note-calme strong { color: inherit; }
.push-message { font-size: 14px; font-weight: 700; color: var(--encre); }
.pile-reglages { display: flex; flex-direction: column; gap: 20px; }
.reglages-push .case input { flex: 0 0 20px; }
.pile-reglages .case-pretable strong { font-size: 15px; }
.pile-reglages .case-pretable .sous-titre { font-size: 13px; font-weight: 400; }
.heures-calmes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.heures-paire { display: inline-flex; align-items: center; gap: 8px; }
.heures-calmes label { font-weight: 400; }
.heures-calmes input[type=time] { min-height: 44px; padding: 0 10px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon); background: var(--surface); color: var(--encre); font: inherit; }
[data-theme="marelle"] .heures-calmes input[type=time] { min-height: 52px; border-width: 2px; }
.heures-calmes input[type=time]:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.liste-appareils { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.liste-appareils li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.liste-appareils li[hidden] { display: none; }
.liste-appareils li > span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.liste-appareils small { font-size: 13px; color: var(--discret); }
.liste-appareils small.a-reactiver { color: var(--attente-texte); font-weight: 700; }
.liste-appareils form { margin: 0; }
.push-proposition { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.push-proposition[hidden] { display: none; }

/* --- Lot « lancement » : textes légaux, accords, mes données (26/10/2026) ---------------- */
/* Pages d'entrée (connexion, bienvenue) : la carte puis le pied légal, l'un sous l'autre. */
.connexion { flex-direction: column; gap: 18px; }
.pied-legal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 16px 24px; font-size: 13px; color: var(--discret); text-align: center; }
.pied-legal nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.pied-legal a { color: var(--lien); }
.pied-legal a:hover { color: var(--lien-survol); }
.pied-moi { display: none; }
@media (max-width: 760px) {
  /* Téléphone connecté : la barre d'onglets occupe le bas de l'écran ; le pied est en bas de « Moi ». */
  body.avec-onglets .pied-page { display: none; }
  .pied-moi { display: flex; padding-bottom: 8px; }
}
/* Case d'accord (conditions, accord parental) : jamais cochée d'avance, cible de 44 px. */
.case-accord { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--surface-douce); border: 1px solid var(--bordure-legere); border-radius: var(--rayon); }
.case-accord.accord-parental { background: var(--accent-doux); border-color: transparent; }
.case-accord.en-erreur { background: var(--danger-doux); border-color: var(--danger-bord); }
.case-accord-libelle { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 400; line-height: 1.45; cursor: pointer; }
.case-accord-libelle input { flex: 0 0 20px; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.case-accord-libelle a { font-weight: 700; }
.case-accord-note { padding-left: 30px; font-size: 13px; }
.case-accord .erreur { font-weight: 700; }
/* Dans un formulaire « pile », l'ordre visuel suit le code (aide et erreur sous le champ). */
form.pile > .case-accord > * { order: 0; }
form.pile > div > .aide { order: 3; }
form.pile > div > .erreur { order: 4; }
.accord-note { display: block; font-size: 13px; margin-top: 2px; }
/* Nouvelles conditions à accepter. */
.liste-resume { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.refus-conditions { border-top: 1px solid var(--bordure-legere); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
/* Bandeau : texte légal mis à jour, signalé une fois. */
.bandeau-textes { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border-radius: var(--rayon); background: var(--neutre-doux); color: var(--encre); font-size: 14px; }
.bandeau-textes form { margin: 0; }
/* Pages légales. */
.page-legale { gap: 18px; }
.onglets-legaux { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.onglets-legaux a { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 8px; border-radius: calc(var(--rayon) - 3px); font-size: 14px; text-align: center; color: var(--discret); text-decoration: none; }
.onglets-legaux a:hover { color: var(--encre); }
.onglets-legaux a[aria-current="page"] { background: var(--surface); color: var(--encre); font-weight: 700; box-shadow: var(--ombre-carte); }
@media (max-width: 520px) { .onglets-legaux { grid-template-columns: repeat(3, minmax(0, 1fr)); } .onglets-legaux a { font-size: 13px; padding: 0 4px; } }
.tete-legale { display: flex; flex-direction: column; gap: 6px; }
.tete-legale .encart-attente { background: var(--attente-doux); color: var(--attente-texte); border-radius: var(--rayon); padding: 10px 14px; font-size: 14px; }
.tete-legale .encart-attente a { color: inherit; font-weight: 700; }
.texte-legal { display: flex; flex-direction: column; gap: 12px; line-height: 1.55; overflow-wrap: break-word; }
.texte-legal h2 { margin: 14px 0 0; font-size: 21px; scroll-margin-top: 80px; }
.texte-legal p, .texte-legal ul { margin: 0; }
.texte-legal ul { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.texte-legal ul ul { margin-top: 6px; }
.sommaire { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); padding: 14px 18px; }
.sommaire ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tableau-legal { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.tableau-legal div { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--bordure-legere); }
.tableau-legal div:first-child { border-top: 0; }
.tableau-legal dt { font-weight: 700; }
.tableau-legal dd { margin: 0; }
.tableau-defilant { overflow-x: auto; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); }
.tableau-legal-grille { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 14px; }
.tableau-legal-grille th, .tableau-legal-grille td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--bordure-legere); }
.tableau-legal-grille thead th { border-top: 0; background: var(--surface-douce); }
.sans-puces { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* Moi › Mes données. */
.liste-accords { margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.liste-accords div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.liste-accords dd { margin: 0; color: var(--discret); text-align: right; }

/* Historique de sécurité (Mon foyer, 01/11/2026) */
.titre-jour { margin: 0; font-size: 15px; color: var(--discret); }
.liste-securite { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.liste-securite li { display: flex; gap: 12px; align-items: baseline; }
.liste-securite time { flex: 0 0 3.2em; font-size: 13px; color: var(--discret); font-variant-numeric: tabular-nums; }
.liste-securite li > span { min-width: 0; overflow-wrap: anywhere; }
.liste-securite .sous-titre { display: block; font-size: 13px; }
