/* Bouquinade : ambiance « bibliothèque cosy ». Papier crème, encre brune, titres en serif,
   couvertures mises en valeur. Polices de l'appareil uniquement (rien de téléchargé). */

:root, [data-theme="cosy"] {
  --papier: #f6efe3;
  --carte: #fffaf1;
  --carte-2: #f9f1e3;
  --encre: #2f2620;
  --encre-douce: #5d5047;
  --discret: #8f8173;
  --trait: #e5d8c3;
  --accent: #9b4a2c;        /* terracotta */
  --accent-clair: #f3dfd2;
  --vert: #3e5f48;          /* vert bibliothèque */
  --vert-clair: #dfeadf;
  --or: #b8892c;
  --or-clair: #f8ecc9;
  --bleu-clair: #e3ebf3;
  --mauve-clair: #efe5f3;
  --rouge: #a3392f;
  --rouge-clair: #f8e1dc;
  --ombre: 0 1px 2px rgba(70, 45, 20, .08), 0 4px 14px rgba(70, 45, 20, .08);
  --ombre-livre: 1px 2px 3px rgba(60, 35, 15, .25), 3px 6px 12px rgba(60, 35, 15, .15);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, Cambria, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rayon: 10px;
  --sur-accent: #fff;       /* texte sur fond accent (boutons) */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  /* Lampe de lecture : brun profond, encre claire */
  :root {
    --papier: #1f1a16; --carte: #2a231e; --carte-2: #322a23; --encre: #efe4d4; --encre-douce: #d3c4b0;
    --discret: #a39581; --trait: #43382e; --accent: #e08a62; --accent-clair: #4a2f24; --vert: #9cc5a5;
    --vert-clair: #2e3d31; --or: #e0b45a; --or-clair: #463a1f; --bleu-clair: #2a3440; --mauve-clair: #3a2e40;
    --rouge: #f0988c; --rouge-clair: #4a2925;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --ombre-livre: 1px 2px 3px rgba(0, 0, 0, .5), 3px 6px 12px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

/* --- Thèmes au choix (en-tête ou Mon compte ; cookie « theme ») ------------------------ */
/* « cosy » (ci-dessus) suit le mode clair ou sombre de l'appareil ; les autres sont fixes.
   Déclarés après : ils l'emportent sur le mode sombre automatique. */

[data-theme="nordique"] {
  /* Nordique : blanc bleuté, encre ardoise, accent bleu fjord, titres sans empattement */
  --papier: #eef2f6; --carte: #ffffff; --carte-2: #f3f6fa; --encre: #1c2733; --encre-douce: #44576b;
  --discret: #77879a; --trait: #d5dde6; --accent: #2a65a8; --accent-clair: #dce8f6; --vert: #2c7a6b;
  --vert-clair: #d8eee8; --or: #b4791e; --or-clair: #fbefd8; --bleu-clair: #e0ebf7; --mauve-clair: #ebe7f6;
  --rouge: #c0392b; --rouge-clair: #f9e0dd; --sur-accent: #fff;
  --ombre: 0 1px 2px rgba(20, 40, 70, .07), 0 4px 14px rgba(20, 40, 70, .07);
  --ombre-livre: 1px 2px 3px rgba(20, 35, 60, .22), 3px 6px 12px rgba(20, 35, 60, .12);
  --serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rayon: 6px;
  color-scheme: light;
}

[data-theme="foret"] {
  /* Forêt : vert sauge, papier recyclé, accent vert sapin, touches d'écorce */
  --papier: #e3eadb; --carte: #f8faf3; --carte-2: #edf2e5; --encre: #22301f; --encre-douce: #4a5a46;
  --discret: #7d8a78; --trait: #d4dbc8; --accent: #2f6a4a; --accent-clair: #d7e8dc; --vert: #6a7b2a;
  --vert-clair: #e4ecd0; --or: #a26a2a; --or-clair: #f4e8d2; --bleu-clair: #e0e9ea; --mauve-clair: #ebe6ee;
  --rouge: #a8412e; --rouge-clair: #f5e0d8; --sur-accent: #fff;
  --ombre: 0 1px 2px rgba(30, 50, 25, .08), 0 4px 14px rgba(30, 50, 25, .08);
  --ombre-livre: 1px 2px 3px rgba(25, 40, 20, .25), 3px 6px 12px rgba(25, 40, 20, .14);
  --serif: Georgia, Cambria, "Times New Roman", serif;
  --rayon: 14px;
  color-scheme: light;
}

/* Forêt : en-tête vert sapin */
[data-theme="foret"] header.site { background: #2b4a37; border-bottom-color: #1f3828; }
[data-theme="foret"] header.site .logo, [data-theme="foret"] header nav a, [data-theme="foret"] header .menu-theme summary,
[data-theme="foret"] nav.compte .lien { color: #e8efe2; }
[data-theme="foret"] header nav a:hover, [data-theme="foret"] header .menu-theme summary:hover { background: #3a5e47; color: #fff; }
[data-theme="foret"] header nav a.actif { background: #e8efe2; color: #2b4a37; }
[data-theme="foret"] header .compteur-nav { color: #b9cbb3; }
[data-theme="foret"] header .menu-theme form button { color: var(--encre); }

[data-theme="nuit"] {
  /* Nuit : bleu nuit, encre claire, accent ambre (toujours sombre) */
  --papier: #11151d; --carte: #19202b; --carte-2: #212a37; --encre: #e7eaf0; --encre-douce: #bac2ce;
  --discret: #8b95a5; --trait: #2d3646; --accent: #f0b54a; --accent-clair: #3a3120; --vert: #7fc8a9;
  --vert-clair: #1e392f; --or: #f2c46b; --or-clair: #3c3320; --bleu-clair: #1e2a3c; --mauve-clair: #2d273f;
  --rouge: #f28b82; --rouge-clair: #43262a; --sur-accent: #1b1406;
  --ombre: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .3);
  --ombre-livre: 1px 2px 3px rgba(0, 0, 0, .55), 3px 6px 12px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------------------- */

* { box-sizing: border-box; }
html { background: var(--papier); }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--encre);
       background: var(--papier); }
main { max-width: 72rem; margin: 0 auto; padding: 1.2rem 1.5rem 3rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--encre); }
h1, h2, h3, .logo { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
h2 { font-size: 1.6rem; margin: 1.2rem 0 .6rem; }
h3 { font-size: 1.2rem; margin: 1.4rem 0 .5rem; }
h2.section, h3.section { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .8rem; }
.muted { color: var(--discret); font-size: .9rem; font-family: var(--sans); font-weight: normal; }
code { background: var(--carte-2); padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
hr { border: none; border-top: 1px solid var(--trait); }

/* --- En-tête et pied --------------------------------------------------------------- */

header.site { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .7rem 1.5rem;
              background: var(--carte); border-bottom: 1px solid var(--trait); box-shadow: var(--ombre); }
.logo { font-size: 1.5rem; color: var(--encre); text-decoration: none; margin-right: .5rem; }
header nav { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; }
header nav a { color: var(--encre-douce); text-decoration: none; padding: .35rem .7rem; border-radius: 999px; }
header nav a:hover { background: var(--carte-2); color: var(--encre); }
header nav a.actif { background: var(--accent-clair); color: var(--accent); font-weight: 600; }
nav.compte { margin-left: auto; }
nav.compte .lien { color: var(--discret); padding: .35rem .5rem; }
footer.site { text-align: center; padding: 2rem 1rem; border-top: 1px solid var(--trait); }

.forms { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; max-width: 72rem;
         margin: 1rem auto 0; padding: 0 1.5rem; }
.forms form { display: flex; gap: .5rem; align-items: center; }
.forms .recherche { flex: 1 1 auto; max-width: 46rem; }
.forms .recherche input { flex: 1; min-width: 8rem; font-size: 1.05rem; padding: .6rem 1.1rem; border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(70, 45, 20, .06); }
.forms .recherche button { border-radius: 999px; padding: .6rem 1.3rem; }
.forms .recherche { position: relative; }
.forms .portee { gap: 0; border: 1px solid var(--trait); border-radius: 999px; overflow: hidden; background: var(--carte); }
.forms .portee button { border: 0; border-radius: 0; background: transparent; color: var(--encre-douce); padding: .45rem .9rem; font-size: .88rem; box-shadow: none; }
.forms .portee button[aria-pressed="true"] { background: var(--accent); color: var(--sur-accent); }
.forms .portee button + button { border-left: 1px solid var(--trait); }
.suggestions { position: absolute; top: calc(100% + .3rem); left: 0; right: 0; z-index: 10; list-style: none; margin: 0;
               padding: .3rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 14px;
               box-shadow: var(--ombre); max-height: 70vh; overflow-y: auto; }
.suggestions a { display: flex; align-items: center; gap: .7rem; padding: .4rem .6rem; border-radius: 10px;
                 color: var(--encre); text-decoration: none; }
.suggestions li[aria-selected=true] a, .suggestions a:hover { background: var(--accent-clair); }
.suggestions img, .suggestions .pastille { width: 30px; height: 45px; object-fit: cover; flex: none;
  border-radius: 2px 4px 4px 2px; box-shadow: var(--ombre-livre); }
.suggestions .pastille { display: flex; align-items: center; justify-content: center; background: var(--carte-2);
                         box-shadow: none; border-radius: 50%; height: 30px; }
.suggestions strong { display: block; font-family: var(--serif); font-weight: 600; }
.suggestions small { color: var(--discret); }
.personnes { display: flex; flex-wrap: wrap; gap: .5rem; }
.personnes .etiquette { font-family: var(--serif); font-size: 1rem; }

/* --- Formulaires ------------------------------------------------------------------- */

input[type=text], input[type=search], input[type=email], input[type=password], select {
  font: inherit; color: var(--encre); background: var(--carte); border: 1px solid var(--trait);
  border-radius: 8px; padding: .45rem .7rem; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; cursor: pointer; border-radius: 8px; padding: .45rem 1rem; border: 1px solid var(--accent);
         background: var(--accent); color: var(--sur-accent); }
button:hover { filter: brightness(1.08); }
button.secondaire-btn, button[type=button] { background: transparent; color: var(--accent); }
button.lien { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline;
              text-underline-offset: 2px; }
button.lien.muted { color: var(--discret); }
button.danger, .danger { color: var(--rouge) !important; }
form.inline { display: inline; }
label { color: var(--encre-douce); }
.bouton { display: inline-block; font-family: var(--sans); font-size: .9rem; font-weight: 600; padding: .3rem .9rem;
          border-radius: 999px; background: var(--accent); color: var(--sur-accent) !important; text-decoration: none; }
.bouton:hover { filter: brightness(1.08); }

.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.3rem 1.6rem;
         max-width: 32rem; box-shadow: var(--ombre); margin: 1rem 0; }
.carte h2 { margin-top: 0; }
.carte form { display: block; }
.carte label { display: block; margin: .8rem 0 .25rem; }
.carte input[type=text], .carte input[type=email], .carte input[type=password], .carte select { width: 100%; }
.carte button[type=submit] { margin-top: 1.1rem; }

/* --- Messages ------------------------------------------------------------------------ */

.error, .warning, .ok { padding: .6rem 1rem; border-radius: 8px; border: 1px solid; }
.error { background: var(--rouge-clair); border-color: var(--rouge); color: var(--encre); }
.warning { background: var(--or-clair); border-color: var(--or); }
.ok { background: var(--vert-clair); border-color: var(--vert); }
.legend { font-size: .85rem; color: var(--discret); margin-top: .6rem; }

/* --- Couvertures -------------------------------------------------------------------- */

.cover img, .hits img, .vignette img, .vignette .sans-couv {
  border-radius: 2px 5px 5px 2px; box-shadow: var(--ombre-livre); background: var(--carte-2); }
.cover { text-align: center; min-height: 1rem; }
.cover img { max-height: 200px; }

/* --- Tableaux de livres ------------------------------------------------------------- */

table { border-collapse: collapse; }
.hits { width: 100%; background: var(--carte); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre);
        border: 1px solid var(--trait); }
.hits th { text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em;
           color: var(--discret); background: var(--carte-2); padding: .55rem .8rem; border-bottom: 1px solid var(--trait); }
.hits td { padding: .6rem .8rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.hits tr:last-child td { border-bottom: none; }
.hits tr:hover td { background: var(--carte-2); }
.hits a { color: var(--encre-douce); text-decoration: none; }
.hits a:hover { color: var(--accent); text-decoration: underline; }
.hits td > a:first-child { font-family: var(--serif); font-size: 1.05rem; color: var(--encre); }
.hits img { height: 64px; display: block; }
tr.secondaire { opacity: .55; }

/* Tableau de complétude du comparateur */
table:not(.hits) { margin-top: 1.5rem; background: var(--carte); }
table:not(.hits) th, table:not(.hits) td { border: 1px solid var(--trait); padding: .3rem .8rem; text-align: center; }
table:not(.hits) th:first-child, table:not(.hits) td:first-child { text-align: left; }
td.ok { background: var(--vert-clair); } td.ko { background: var(--rouge-clair); color: var(--rouge); }

/* --- Fiche d'un livre --------------------------------------------------------------- */

.livre { display: flex; gap: 2.5rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 14px;
         padding: 2rem; max-width: 64rem; box-shadow: var(--ombre); }
.livre .cover img { max-height: 340px; width: auto; }
.livre h2 { font-size: 2.1rem; line-height: 1.15; margin: 0; }
.livre .sous-titre { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--encre-douce); margin: .3rem 0 0; }
.livre .auteurs { font-family: var(--serif); font-size: 1.25rem; margin: .8rem 0 .4rem; }
.livre .auteurs a { color: var(--encre); }
.livre .credits { color: var(--encre-douce); margin: .2rem 0; }
.livre dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; margin: 1.3rem 0 0;
            padding-top: 1rem; border-top: 1px dashed var(--trait); }
.livre dt { color: var(--discret); font-size: .85rem; align-self: baseline; }
.livre dd { margin: 0; }
.livre .resume-livre { font-family: var(--serif); font-size: 1.08rem; line-height: 1.65; margin-top: 1.3rem;
                       max-width: 42rem; color: var(--encre); }
.livre .sujets { margin-top: 1rem; font-size: .85rem; color: var(--discret); }
.livre .actions { margin-top: 1.3rem; font-size: .85rem; }
.mes-exemplaires { margin-top: 1.2rem; padding: .8rem 1.1rem; background: var(--vert-clair); border-radius: var(--rayon); }
.mes-exemplaires p { margin: .25rem 0; }
.ajout-liste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }

.badges { margin: .7rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.badge-liste, .badge-perso { display: inline-block; border-radius: 999px; padding: .15rem .8rem; font-size: .9rem;
                             text-decoration: none; border: 1px solid; }
.badge-liste { background: var(--or-clair); border-color: var(--or); color: var(--encre); }
.badge-liste::before { content: "🏆 "; }
.badge-perso { background: var(--bleu-clair); border-color: var(--trait); color: var(--encre); }
.badge-perso::before { content: "📚 "; }
.badge-coeur { display: inline-block; border-radius: 999px; padding: .15rem .8rem; font-size: .9rem; margin: 0 .3rem .3rem 0;
  background: var(--rouge-clair); border: 1px solid var(--rouge); color: var(--encre); text-decoration: none; }
.badge-coeur::before { content: "♥ "; color: var(--rouge); }
.bouton-coeur { background: transparent; color: var(--rouge); border-color: var(--rouge); }
.bouton-coeur.actif { background: var(--rouge-clair); font-weight: 600; }
.ajout-liste form { display: flex; gap: .4rem; align-items: center; }
.bouton-etoile { font-family: var(--sans); font-size: .85rem; font-weight: normal; padding: .2rem .8rem; border-radius: 999px;
  background: transparent; color: var(--or); border-color: var(--or); }
.bouton-etoile.actif { background: var(--or-clair); color: var(--encre); font-weight: 600; }
.lus-auteur { margin-top: -.3rem; }
.liste-favoris::before { content: "♥ "; color: var(--rouge); }

/* --- Étagère de livres (catalogue, recherche, auteur) ------------------------------- */

.etagere { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.8rem 1.4rem;
           margin: .5rem 0 1rem; }
.carte-livre { display: flex; flex-direction: column; font-size: .88rem; line-height: 1.35; }
.carte-livre .couv { display: block; margin-bottom: .6rem; }
.carte-livre .couv img, .carte-livre .sans-couv { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; display: block;
  border-radius: 2px 6px 6px 2px; box-shadow: var(--ombre-livre); transition: transform .15s ease, box-shadow .15s ease; }
.carte-livre:hover .couv img, .carte-livre:hover .sans-couv { transform: translateY(-4px) rotate(-.7deg); }
.carte-livre h4 { font-family: var(--serif); font-size: 1.02rem; font-weight: 600; margin: 0 0 .15rem; line-height: 1.25; }
.carte-livre h4 a { color: var(--encre); text-decoration: none; }
.carte-livre p { margin: .1rem 0; }
.carte-livre a { text-decoration: none; }
.carte-livre a:hover { text-decoration: underline; }
.carte-livre .par a { color: var(--encre-douce); }
.carte-livre .serie, .carte-livre .edition, .carte-livre .edition a { color: var(--discret); font-size: .82rem; }
.carte-livre .vo { font-style: italic; margin-top: -.2rem; }
.carte-livre.ailleurs .couv img { filter: saturate(.85); }
.carte-livre .couv img.couv-isbn { position: absolute; inset: 0; height: 100%; }  /* sur la fausse couverture */
.chargement::before { content: "⏳ "; }

/* Fausse couverture : titre en serif sur une teinte douce, liseré comme une reliure */
.sans-couv { display: flex !important; flex-direction: column; justify-content: space-between; padding: 14% 10%;
             color: #fdf6ea; font-family: var(--serif); text-align: center; overflow: hidden;
             background-image: linear-gradient(90deg, rgba(0,0,0,.18) 0 6%, rgba(255,255,255,.08) 6% 7.5%, transparent 7.5%); }
.sans-couv .t { font-size: 1.05rem; line-height: 1.2; font-weight: 600; }
.sans-couv .a { font-size: .78rem; opacity: .85; }
.teinte-0 { background-color: #7a3b2e; } .teinte-1 { background-color: #3e5f48; } .teinte-2 { background-color: #2f4a63; }
.teinte-3 { background-color: #8a6a2f; } .teinte-4 { background-color: #5b3d5e; }

/* --- Rangées de couvertures --------------------------------------------------------- */

.vignettes { max-width: 72rem; margin-top: 2rem; }
.vignettes h3 { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.rangee { display: flex; gap: 1.3rem; overflow-x: auto; padding: .4rem .2rem 1rem; scroll-snap-type: x proximity; }
.vignette { width: 118px; flex: none; text-decoration: none; color: var(--encre); font-size: .85rem; scroll-snap-align: start; }
.vignette span { display: block; }
.vignette > span:first-of-type { font-family: var(--serif); font-size: .95rem; line-height: 1.25; margin-top: .45rem; }
.vignette img, .vignette .sans-couv { width: 118px; height: 176px; object-fit: cover; display: block;
                                      transition: transform .15s ease; }
.vignette .sans-couv .t { font-size: .85rem; }
.vignette:hover img { transform: translateY(-3px) rotate(-.6deg); }

/* --- Filtres, étiquettes, tri ------------------------------------------------------- */

.filtres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 1rem; }
.etiquette { background: var(--accent-clair); border: 1px solid transparent; border-radius: 999px; padding: .15rem .75rem;
             text-decoration: none; color: var(--accent); font-size: .9rem; }
.etiquette:hover { border-color: var(--accent); color: var(--accent); }
.tri { margin-left: auto; font-size: .9rem; color: var(--discret); }
.tri strong { color: var(--encre); }
.pagination { margin-top: 1rem; text-align: center; }
.filtres-groupe { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.filtres-groupe input[type=text] { flex: 1 1 16rem; }

/* --- Statut des exemplaires --------------------------------------------------------- */

.dispo { font-size: .82rem; padding: .1rem .55rem; border-radius: 999px; background: var(--carte-2); white-space: nowrap;
         border: 1px solid var(--trait); }
.dispo-pretable { background: var(--bleu-clair); } .dispo-donnable { background: var(--vert-clair); }
.dispo-a_vendre { background: var(--or-clair); } .dispo-a_echanger { background: var(--mauve-clair); }
.masque { color: var(--rouge); font-size: .85rem; }

/* --- Demandes et prêts ------------------------------------------------------------ */

.compteur-nav { font-size: .75rem; color: var(--discret); font-weight: normal; margin-left: .15rem; }
.pastille-compte { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--accent);
                   color: var(--sur-accent); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4; }
.colonnes-demandes { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.5rem; }
.demande { display: flex; gap: 1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon);
           padding: .9rem 1rem; margin-bottom: .7rem; box-shadow: var(--ombre); }
.demande .couv img { width: 56px; height: 84px; object-fit: cover; border-radius: 2px 4px 4px 2px; box-shadow: var(--ombre-livre); }
.demande h4 { font-family: var(--serif); margin: 0 0 .2rem; font-size: 1.1rem; }
.demande h4 a { color: var(--encre); text-decoration: none; }
.demande p { margin: .2rem 0; }
.demande .message { font-family: var(--serif); font-style: italic; color: var(--encre-douce); }
.demande .actions-demande { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.type-demande { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--carte-2);
                border: 1px solid var(--trait); border-radius: 999px; padding: 0 .5rem; margin-right: .3rem; }
.statut-en_attente { border-left: 4px solid var(--or); } .statut-acceptee { border-left: 4px solid var(--vert); }
.statut-remise { border-left: 4px solid var(--accent); }
.statut-refusee, .statut-annulee, .statut-rendue, .statut-transferee { opacity: .7; }
.prete { font-size: .82rem; background: var(--accent-clair); color: var(--accent); border-radius: 999px; padding: .05rem .5rem; }
.chez { margin: .3rem 0; }
.demander { display: inline-block; margin: 0 0 0 .3rem; }
.demander summary { color: var(--accent); font-weight: 600; font-size: .9rem; }
.demander form { display: flex; gap: .4rem; margin-top: .4rem; flex-wrap: wrap; }
.demander input[type=text] { flex: 1 1 14rem; }
.historique-exemplaire { padding-left: 1.1rem; } .historique-exemplaire li { margin: .3rem 0; }

/* --- Vues de « Ma bibliothèque » ------------------------------------------------------ */

.vues { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 1.2rem; padding: .25rem; background: var(--carte-2);
        border: 1px solid var(--trait); border-radius: 999px; width: fit-content; }
.vues a { padding: .3rem .9rem; border-radius: 999px; text-decoration: none; color: var(--encre-douce); font-size: .92rem; }
.vues a.actif { background: var(--carte); color: var(--accent); font-weight: 600; box-shadow: var(--ombre); }

/* Mosaïque : couvertures serrées */
.mosaique { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.mosaique a { position: relative; display: block; }
.mosaique img, .mosaique .sans-couv { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; display: block;
  border-radius: 2px 5px 5px 2px; box-shadow: var(--ombre-livre); transition: transform .15s ease; }
.mosaique .sans-couv .t { font-size: .75rem; } .mosaique .sans-couv .a { font-size: .65rem; }
.mosaique a:hover img, .mosaique a:hover .sans-couv { transform: scale(1.06); position: relative; z-index: 1; }
.mosaique .masque-vue { opacity: .45; }
.ruban { position: absolute; top: 6px; right: -2px; background: var(--accent); color: var(--sur-accent); font-size: .68rem;
         padding: .05rem .4rem; border-radius: 3px 0 0 3px; box-shadow: var(--ombre); }

/* Étagères : dos des livres debout sur des planches */
.etageres { display: flex; flex-wrap: wrap; align-content: flex-start; padding: 0 1.2rem; border-radius: 10px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 236px, #8a5a36 236px 248px, #6b4428 248px 252px),
    linear-gradient(#efe4d2, #e6d6bd);
  box-shadow: inset 0 0 0 10px #7a4e2f, inset 0 0 30px rgba(60, 35, 15, .25); padding-top: 10px; }
.emplacement { height: 242px; display: flex; align-items: flex-end; padding-bottom: 10px; margin-right: 3px; }
.dos { display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none;
       color: #fdf6ea; border-radius: 3px 3px 1px 1px; padding: 8px 0 6px; overflow: hidden;
       box-shadow: inset -3px 0 4px rgba(0,0,0,.25), inset 2px 0 2px rgba(255,255,255,.15), 1px 0 2px rgba(0,0,0,.3);
       transition: transform .15s ease; }
.dos:hover { transform: translateY(-8px); }
/* Titre et auteur se partagent la hauteur sans se toucher : chacun coupé avec « … » si trop long */
.dos-titre { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--serif); font-size: .8rem;
             font-weight: 600; line-height: 1.1; flex: 0 1 auto; min-height: 0; overflow: hidden;
             text-overflow: ellipsis; white-space: nowrap; }
.dos-auteur { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .62rem; opacity: .85; flex: 0 0 auto;
              max-height: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dos-prete { outline: 2px dashed var(--or); outline-offset: -4px; }
.teinte-dos-0 { background: #7a3b2e; } .teinte-dos-1 { background: #3e5f48; } .teinte-dos-2 { background: #2f4a63; }
.teinte-dos-3 { background: #8a6a2f; } .teinte-dos-4 { background: #5b3d5e; } .teinte-dos-5 { background: #2e2a26; }
.teinte-dos-6 { background: #9c5b3b; } .teinte-dos-7 { background: #48606b; }

/* Par auteur */
.initiales { display: flex; flex-wrap: wrap; gap: .2rem; margin-bottom: 1rem; }
.initiales a { font-family: var(--serif); font-weight: 600; padding: .1rem .5rem; border-radius: 6px; text-decoration: none; }
.initiales a:hover { background: var(--accent-clair); }
.groupe-initiale h3 { font-size: 1.6rem; border-bottom: 1px solid var(--trait); color: var(--accent); }
.par-auteur { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .6rem 1.5rem; }
.par-auteur li { display: flex; gap: .7rem; align-items: center; }
.par-auteur li > span > a { font-family: var(--serif); color: var(--encre); text-decoration: none; }
.couv-mini { flex: none; display: block; width: 40px; }
.couv-mini img, .couv-mini .sans-couv { width: 40px; height: 60px; object-fit: cover; display: block;
  border-radius: 1px 3px 3px 1px; box-shadow: var(--ombre-livre); }
.couv-mini .sans-couv { padding: 4px; } .couv-mini .sans-couv .t { font-size: .45rem; } .couv-mini .sans-couv .a { display: none; }

/* Disponibilités : colonnes */
.colonnes-dispo { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; align-items: start; }
.colonne { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .7rem; box-shadow: var(--ombre); }
.colonne h3 { margin: .2rem 0 .6rem; font-size: 1.05rem; }
.dispo-col-pretes { border-top: 4px solid var(--accent); } .dispo-col-pretable { border-top: 4px solid #6b8fb3; }
.dispo-col-donnable { border-top: 4px solid var(--vert); } .dispo-col-a_vendre { border-top: 4px solid var(--or); }
.dispo-col-a_echanger { border-top: 4px solid #8a6aa0; } .dispo-col-garde { border-top: 4px solid var(--discret); }
.carte-dispo { display: flex; gap: .6rem; align-items: center; padding: .35rem; border-radius: 8px; text-decoration: none;
               color: var(--encre); font-size: .9rem; }
.carte-dispo:hover { background: var(--carte-2); }

/* --- Suivi de lecture -------------------------------------------------------------- */

.ma-lecture { margin-top: 1.2rem; padding: .8rem 1.1rem; background: var(--bleu-clair); border-radius: var(--rayon); }
.titre-encadre { margin: 0 0 .5rem; font-weight: 600; display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.boutons-lecture { display: flex; flex-wrap: wrap; gap: .4rem; }
.bouton-lecture { padding: .3rem .8rem; font-size: .9rem; border-radius: 999px; background: var(--carte); }
.lecture-statut { font-size: .82rem; padding: .05rem .6rem; border-radius: 999px; color: #fff; background: var(--discret); }
.lecture-en_cours { background: var(--accent); color: var(--sur-accent); } .lecture-a_lire { background: #6b8fb3; } .lecture-repere { background: #a08a5c; }
.repere-ou { margin: .3rem 0 0; font-size: .88rem; }
.lecture-passee { margin: .4rem 0 0; }
.annee-lecture { margin-bottom: 2rem; }
.annee-lecture h3 { display: flex; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--trait); padding-bottom: .3rem; }
.annee { font-size: 2rem; color: var(--accent); }
.frise { display: flex; flex-wrap: wrap; gap: 1rem .9rem; }
.lecture-frise { width: 92px; text-align: center; }
.couv-lecture { display: block; }
.couv-lecture img, .couv-lecture .sans-couv { width: 92px; height: 138px; object-fit: cover; display: block;
  border-radius: 2px 5px 5px 2px; box-shadow: var(--ombre-livre); transition: transform .15s ease; }
.couv-lecture .sans-couv .t { font-size: .72rem; }
.couv-lecture:hover img, .couv-lecture:hover .sans-couv { transform: translateY(-3px) rotate(-.8deg); }
.lecture-frise .date { margin: .3rem 0 0; font-size: .8rem; color: var(--discret); }
.lecture-frise .etoiles { margin: 0; color: var(--or); font-size: .8rem; letter-spacing: 1px; }
.lecture-frise.abandonnee { opacity: .5; }
.etagere .couv-lecture img, .etagere .couv-lecture .sans-couv { width: 100%; height: auto; aspect-ratio: 2 / 3; }
.note-etoiles { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .1rem; align-items: center; }
.note-etoiles input { display: none; }
.note-etoiles label { display: inline; margin: 0; font-size: 1.6rem; color: var(--trait); cursor: pointer; }
.note-etoiles label.sans-note { font-size: .85rem; margin-left: .8rem; order: -1; }
.note-etoiles input:checked ~ label:not(.sans-note), .note-etoiles label:not(.sans-note):hover,
.note-etoiles label:not(.sans-note):hover ~ label:not(.sans-note) { color: var(--or); }
input[type=date] { font: inherit; color: var(--encre); background: var(--carte); border: 1px solid var(--trait);
                   border-radius: 8px; padding: .4rem .6rem; }

/* --- Import -------------------------------------------------------------------------- */

.carte.large { max-width: 46rem; }
textarea { width: 100%; font: inherit; font-family: ui-monospace, monospace; font-size: .9rem; color: var(--encre);
           background: var(--carte); border: 1px solid var(--trait); border-radius: 8px; padding: .6rem .8rem; }
fieldset.reglage { border: 1px solid var(--trait); border-radius: 8px; margin: 1rem 0 0; padding: .4rem 1rem .6rem; }
fieldset.reglage label { display: block; margin: .3rem 0; }
.bilan { font-size: 1.1rem; } .a-verifier { color: var(--rouge); font-weight: 600; }
.statut-import { font-size: .82rem; padding: .05rem .5rem; border-radius: 999px; background: var(--carte-2); white-space: nowrap; }
.statut-import.statut-ajoute { background: var(--vert-clair); } .statut-import.statut-doublon { background: var(--bleu-clair); }
.statut-import.statut-introuvable, .statut-import.statut-invalide, .statut-import.statut-erreur { background: var(--rouge-clair); }
.statut-import.statut-en_attente { background: var(--or-clair); }
.corriger { display: flex; gap: .3rem; flex-wrap: wrap; }

/* --- Pages diverses ---------------------------------------------------------------- */

.historique { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; margin-top: 2rem; }
.historique section { flex: 1 1 28rem; }
.historique h2 { font-size: 1.2rem; }
.historique .hits img { height: 48px; }
ul.groupes { list-style: none; padding: 0; margin: .5rem 0 1rem; }
ul.groupes li { padding: .6rem .9rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 8px;
                margin-bottom: .4rem; }
ul.groupes li > a:first-child { font-family: var(--serif); font-size: 1.1rem; }
.invitation { max-width: 42rem; }
.invitation input[type=text] { width: 100%; font-size: .9rem; margin: .3rem 0 .5rem; }
.ajout video { width: 100%; max-height: 50vh; margin-top: .8rem; background: #000; border-radius: 8px; }
.modifier-liste { margin-top: 2rem; } .modifier-liste summary { cursor: pointer; font-weight: 600; }
.actions-entree { white-space: nowrap; text-align: right; }
.liste td:first-child { white-space: nowrap; font-family: var(--serif); font-size: 1.05rem; color: var(--encre-douce); }
.auteur h2 { font-size: 2.2rem; margin-bottom: .2rem; }
.presentation { display: flex; gap: 1.5rem; align-items: flex-start; max-width: 54rem; margin: .8rem 0 1rem; }
.portrait { width: 120px; height: 150px; object-fit: cover; border-radius: 10px; box-shadow: var(--ombre); flex: none; }
.description-courte { font-family: var(--serif); font-style: italic; color: var(--encre-douce); margin: 0 0 .4rem; }
.resume-auteur { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; margin: 0; }
.source-auteur { margin-top: .4rem; }
@media (max-width: 720px) { .presentation { flex-direction: column; } }

/* Comparateur et recherche (outils de la phase 0) */
.meta { color: var(--discret); margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.col { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem; box-shadow: var(--ombre); }
.col h2 { font-size: 1.15rem; margin: 0 0 .3rem; display: flex; justify-content: space-between; }
.fiche { margin-bottom: 1rem; border-color: var(--vert); }
.fiche-body { display: flex; gap: 1.5rem; } .fiche-body dl { flex: 1; }
.fiche dt .src { text-transform: none; }
.badge { font-size: .75rem; padding: .1rem .5rem; border-radius: 10px; font-weight: normal; }
.trouve { background: var(--vert-clair); } .non_trouve { background: var(--carte-2); } .erreur { background: var(--rouge-clair); }
.timing { font-size: .8rem; color: var(--discret); margin-bottom: .6rem; }
dl { margin: 0; } dt { font-size: .75rem; color: var(--discret); margin-top: .5rem; text-transform: uppercase; }
dd { margin: 0; word-wrap: break-word; }
dd.empty { color: var(--discret); font-style: italic; }
dd.diff { background: var(--or-clair); outline: 2px solid var(--or); padding: 0 .2rem; }
.resume { max-height: 8rem; overflow: auto; font-size: .9rem; }
.notes { font-size: .8rem; color: var(--or); }
details { margin-top: .8rem; } summary { cursor: pointer; color: var(--encre-douce); }
pre { max-height: 400px; overflow: auto; font-size: .75rem; background: var(--carte-2); padding: .5rem; white-space: pre-wrap; }
.src { font-size: .7rem; padding: .05rem .45rem; border-radius: 8px; margin-right: .2rem; color: #fff; }
.src-openlibrary { background: #5b7fa3; } .src-googlebooks { background: #c0563b; } .src-bnf { background: #3d7a4f; }
.sup { font-size: .75rem; padding: .05rem .45rem; border-radius: 8px; border: 1px solid; white-space: nowrap; }
.sup-papier { color: var(--vert); border-color: var(--vert); background: var(--vert-clair); }
.sup-numerique { color: #6a3d9a; border-color: #c3a6e0; background: var(--mauve-clair); }
.sup-audio { color: #9a5b1d; border-color: #e3bb8c; background: var(--or-clair); }

/* --- Petits écrans ------------------------------------------------------------------- */

@media (max-width: 720px) {
  main { padding: 1rem; }
  header.site { padding: .6rem 1rem; }
  nav.compte { margin-left: 0; }
  .forms { padding: 0 1rem; }
  .forms .recherche { flex: 1 1 100%; }
  .forms input { min-width: 0 !important; }
  .etagere { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1.2rem 1rem; }
  .livre { flex-direction: column; gap: 1.2rem; padding: 1.2rem; }
  .livre .cover img { max-height: 260px; }
  .livre h2 { font-size: 1.6rem; }
  .hits { display: block; overflow-x: auto; }
  .grid { grid-template-columns: 1fr !important; }
  .tri { margin-left: 0; }
}
.vignette .detail-edition { display: block; font-size: .78rem; }

/* Page auteur : prix littéraires (Wikidata et listes importées) */
.distinctions { margin-top: 1.2rem; }
.distinctions h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.palmares { list-style: none; padding: 0; margin: 0 0 .6rem; columns: 2 22rem; column-gap: 2rem; }
.palmares li { display: flex; gap: .7rem; padding: .2rem 0; break-inside: avoid; }
.palmares .annee { color: var(--discret); font-variant-numeric: tabular-nums; min-width: 2.6rem; font-size: inherit; font-family: inherit; line-height: inherit; }

/* Page auteur : graphies et administration */
.autres-noms { margin-top: -.4rem; }
.admin-personne { margin: 1.5rem 0; padding: .8rem 1rem; border: 1px dashed var(--trait); border-radius: var(--rayon); }
.admin-personne form { margin: .6rem 1.2rem .4rem 0; display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.plus-de-livres summary { cursor: pointer; color: var(--accent); margin: .4rem 0 .8rem; }

/* Drapeau de la langue, au coin de la couverture */
.carte-livre .couv, .vignette { position: relative; }
.drapeau { position: absolute; top: .35rem; right: .35rem; z-index: 2; font-size: .95rem; line-height: 1;
  padding: .15rem .2rem; border-radius: 4px; background: rgba(255, 250, 241, .85); box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  font-family: "Twemoji Country Flags", "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
dd .drapeau { position: static; box-shadow: none; background: none; padding: 0; }
.langues-lues { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; }
.langues-lues label { display: inline-flex; gap: .35rem; align-items: center; margin: 0; font-weight: normal; }
.langues-lues .drapeau { position: static; box-shadow: none; background: none; padding: 0; }
.langues-lues button { flex-basis: 100%; max-width: max-content; }
.carte-livre { position: relative; }
a.drapeau { text-decoration: none; }
a.drapeau:hover { background: var(--carte); box-shadow: 0 0 0 2px var(--accent); }
.filtre-langues { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; margin: .2rem 0 1rem; color: var(--encre-douce); font-size: .92rem; }
.filtre-langues a { text-decoration: none; }
.filtre-langues .drapeau { position: static; box-shadow: none; background: none; padding: 0; }
.filtre-langues .langue-choisie { color: var(--accent); }
.distinctions summary { cursor: pointer; list-style: none; }
.distinctions summary::-webkit-details-marker { display: none; }
.distinctions summary h3 { display: inline; }
.distinctions summary::before { content: "▸ "; color: var(--accent); }
.distinctions[open] summary::before { content: "▾ "; }
.distinctions[open] summary { margin-bottom: .4rem; }

/* Scan à la suite et emplacements */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modes-scan { border: 0; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.modes-scan label { font-weight: normal; display: flex; align-items: center; gap: .35rem; }
.camera-zone { margin-top: .8rem; border: 3px solid transparent; border-radius: 11px; transition: border-color .15s; }
.camera-zone.flash { border-color: var(--vert); }
.camera-zone video { margin-top: 0; display: block; }
.camera-zone button { margin-top: .5rem; }
.scan-bilan { font-weight: 600; color: var(--vert); }
.scan-session { list-style: none; padding: 0; margin: .6rem 0 1rem; }
.scan-session li { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; margin-bottom: .35rem;
                   border-radius: 8px; background: var(--carte-2); border-left: 4px solid var(--trait); }
.scan-session li img { height: 52px; border-radius: 3px; box-shadow: var(--ombre-livre); flex: none; }
.scan-session li > span { flex: 1; min-width: 0; }
.scan-session .scan-statut { font-size: .88rem; color: var(--encre-douce); }
.scan-session li.scan-ajoute, .scan-session li.scan-range { border-left-color: var(--vert); }
.scan-session li.scan-deja_la { border-left-color: var(--discret); }
.scan-session li.scan-absent { border-left-color: var(--or); background: var(--or-clair); }
.scan-session li.scan-erreur, .scan-session li.scan-invalide,
.scan-session li.scan-indisponible { border-left-color: var(--rouge); background: var(--rouge-clair); }
.scan-session li.scan-en_attente { border-left-color: var(--or); background: var(--or-clair); }
.scans-attente { margin: 1rem 0; padding: .8rem 1rem; border: 1px solid var(--or); border-radius: var(--rayon); background: var(--or-clair); }
.scans-attente[hidden] { display: none; }
.scans-attente h3 { margin-top: 0; }
.scans-attente ul { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.scan-session li.scan-annule { opacity: .55; }
.scan-session li.scan-annule a { text-decoration: line-through; }
.lieu { font-size: .88rem; color: var(--encre-douce); white-space: nowrap; }
.lieu.non-range { color: var(--discret); font-style: italic; }
.lieux { display: flex; flex-wrap: wrap; gap: .3rem; margin: -.6rem 0 1.2rem; align-items: center; font-size: .9rem; }
.lieux a { padding: .2rem .7rem; border-radius: 999px; text-decoration: none; background: var(--carte-2);
           color: var(--encre-douce); border: 1px solid var(--trait); }
.lieux a.actif { background: var(--vert-clair); color: var(--vert); border-color: var(--vert); font-weight: 600; }
table.lieux-table td { vertical-align: middle; }
table.lieux-table form { display: flex; gap: .6rem; margin: 0; align-items: center; }

/* Étiquettes QR des emplacements */
.bouton.secondaire { background: var(--carte); color: var(--accent) !important; border: 1px solid var(--accent); }
.lieu-entete { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.actions-lieu { display: flex; gap: .5rem; flex-wrap: wrap; }
.qr-mini { display: flex; flex-direction: column; align-items: center; text-decoration: none; font-size: .8rem; }
.qr-mini svg { width: 96px; height: 96px; }
.planche-qr { display: grid; grid-template-columns: repeat(auto-fill, minmax(9cm, 1fr)); gap: 0; margin: 1rem 0; }
.etiq-qr { display: flex; align-items: center; gap: .5cm; padding: .4cm; border: 1px dashed #bbb; background: #fff;
             color: #000; break-inside: avoid; page-break-inside: avoid; min-height: 4cm; }
.etiq-qr svg { width: 3.2cm; height: 3.2cm; flex: none; }
.etiq-qr strong { display: block; font-family: var(--serif); font-size: 1.5rem; line-height: 1.15; }
.etiq-url { display: block; font-size: .7rem; color: #555; word-break: break-all; margin-top: .3rem; }
.etiq-marque { display: block; font-size: .75rem; color: #555; margin-top: .2rem; }
@media print {
  header.site, footer.site, form.recherche, form.portee, .no-print { display: none !important; }
  html, body, main { background: #fff !important; margin: 0; padding: 0; }
  .planche-qr { grid-template-columns: repeat(2, 1fr); margin: 0; }
}
.flash-choix { outline: 3px solid var(--vert); outline-offset: 2px; transition: outline-color .3s; }
/* Le tableau tient dans la carte (plus large que les autres) ; sur petit écran, il défile seul */
.carte.lieux-gestion { max-width: 62rem; }
.tableau-defilant { overflow-x: auto; margin: 0 -.2rem; padding: 0 .2rem; }
.lieux-gestion .hits { box-shadow: none; border: 1px solid var(--trait); }  /* déjà dans une carte */
.lieux-table input[type=text] { min-width: 12rem; flex: 1; }
.lieux-table td:nth-child(3), .lieux-table td.nb-livres, .lieux-table td.action-ligne { white-space: nowrap; }
.lieux-table td.action-ligne { text-align: right; }
/* Boutons à côté de leur champ (pas en dessous, comme dans les autres cartes) */
.lieux-gestion .lieux-table button, .lieux-gestion .ajout-liste button,
.lieux-gestion .pieces-liste button { margin-top: 0; }
.lieux-gestion .ajout-liste { flex-wrap: nowrap; }
.lieux-gestion .ajout-liste input[type=text] { width: auto; flex: 1 1 16rem; max-width: 24rem; }
.lieux-gestion .pieces-liste input[type=text] { width: 14rem; }
.fiche-manuelle { max-width: 34rem; }
.fiche-manuelle textarea { width: 100%; font: inherit; }
.champs-ligne { display: flex; gap: 1rem; }
.champs-ligne > span { flex: 1; }
.modifier-fiche { margin: 1rem 0; }
.modifier-fiche summary { cursor: pointer; color: var(--accent); }
.livre-inconnu { max-width: 42rem; }
/* Ranger depuis Ma bibliothèque */
.barre-ranger { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: 0 0 .8rem;
                padding: .5rem .8rem; background: var(--carte-2); border: 1px solid var(--trait); border-radius: var(--rayon); }
.barre-ranger label { margin: 0; font-weight: normal; }
.barre-ranger select { width: auto; }
#nb-selection { flex-basis: 100%; font-size: .88rem; }
select.lieu-ligne { width: auto; max-width: 14rem; font-size: .88rem; padding: .2rem .4rem; background: transparent;
                    border-color: transparent; color: var(--encre-douce); cursor: pointer; }
select.lieu-ligne:hover, select.lieu-ligne:focus { border-color: var(--trait); background: var(--carte); }
select.lieu-ligne.non-range { color: var(--discret); font-style: italic; }
select.lieu-ligne.enregistre { border-color: var(--vert); background: var(--vert-clair); }
tr.parti { opacity: .4; }
.tableau-biblio td:first-child, .tableau-biblio th:first-child { width: 1.5rem; padding-right: 0; }

/* Ajouter par titre */
.propositions { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .8rem; }
.proposition { display: grid; grid-template-columns: 48px 1fr; gap: .8rem; align-items: start;
  padding: .6rem .7rem; border: 1px solid var(--trait); border-radius: var(--rayon); }
.proposition select { width: 100%; max-width: 100%; }
.prop-introuvable, .prop-erreur { background: var(--bleu-clair); }
.couv-prop img { width: 48px; border-radius: 3px; display: block; }
.saisie { margin: 0 0 .35rem; font-weight: 600; }
.pastille-incertain { font-size: .78rem; font-weight: 500; padding: .05rem .5rem; border-radius: 999px;
  background: #e9c46a; color: #3b2f12; margin-left: .4rem; }
.bilan-titres { padding-left: 1.2rem; }
.bilan-introuvable a, .bilan-erreur a { color: var(--discret); }
.form-par-titre .reglage label { display: block; }

/* Priorisation des lectures : envie, lisible maintenant */
.filtres-lecture { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0 1rem; }
.puce-filtre { padding: .2rem .8rem; border: 1px solid var(--trait); border-radius: 999px; text-decoration: none;
  color: inherit; font-size: .9rem; background: var(--carte); }
.puce-filtre.actif { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.section-envie { margin-bottom: 1.6rem; }
.section-envie h3 { border-bottom: 1px solid var(--trait); padding-bottom: .25rem; }
.envie-3 h3 { color: var(--accent); }
.envie-1 { opacity: .85; }
.ou-trouver { margin: .25rem 0 0; font-size: .82rem; }
.ou-moi { color: #2f6b3a; } .ou-ami { color: #2f5a8a; } .ou-attente, .ou-aucune { color: var(--discret); }
.choix-envie { display: flex; margin: .35rem 0 0; }
.choix-envie button { flex: 1; padding: .1rem .25rem; font-size: .72rem; border-radius: 0; background: var(--carte);
  color: var(--discret); border: 1px solid var(--trait); margin-left: -1px; white-space: nowrap; }
.choix-envie button:first-of-type { border-radius: 999px 0 0 999px; margin-left: 0; }
.choix-envie button:last-of-type { border-radius: 0 999px 999px 0; }
.choix-envie button.actif { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }
.envie-fiche { max-width: 22rem; margin: 0 0 .5rem; }

/* Parutions d'un éditeur, d'une collection */
.explorer { font-size: .85rem; margin-left: .4rem; white-space: nowrap; }
.annee-libre input { width: 6.5rem; padding: .2rem .5rem; font-size: .9rem; }
.parution .marques { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .25rem 0; font-size: .8rem; }
.marque { padding: .02rem .5rem; border-radius: 999px; color: #fff; }
.marque-moi { background: #2f6b3a; } .marque-ami { background: #2f5a8a; }
.bouton-reperer { margin-top: .2rem; font-size: .8rem; padding: .15rem .7rem; }

/* Icônes des emplacements */
.ico-lieu { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.titre-lieu { display: flex; align-items: center; gap: .5rem; }
.titre-lieu .ico-lieu { width: 1.6em; height: 1.6em; }
.choix-icone { position: relative; display: inline-block; }
.choix-icone > summary { list-style: none; cursor: pointer; padding: .2rem .35rem; border-radius: 8px; border: 1px dashed var(--trait);
  display: inline-flex; line-height: 1; }
.choix-icone > summary::-webkit-details-marker { display: none; }
.choix-icone > summary:hover, .choix-icone[open] > summary { border-color: var(--accent); color: var(--accent); }
.grille-icones { position: absolute; z-index: 20; top: calc(100% + .3rem); left: 0; display: grid; grid-template-columns: repeat(2, 11rem);
  gap: .25rem; padding: .5rem; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: 0 6px 20px rgba(0,0,0,.12); font-size: .88rem; font-weight: 400; }
.grille-icones button { display: flex; align-items: center; gap: .5rem; background: transparent; color: inherit; border: 1px solid transparent;
  padding: .3rem .5rem; text-align: left; border-radius: 8px; }
.grille-icones button:hover { background: var(--bleu-clair); }
.grille-icones button.actif { border-color: var(--accent); color: var(--accent); }
.grille-icones .ico-lieu { width: 1.5em; height: 1.5em; }
.etiq-qr strong .ico-lieu { width: 1.2em; height: 1.2em; }

/* Lien vers mon compte (en-tête) */
.lien-compte { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem .2rem .3rem; border-radius: 999px;
  border: 1px solid var(--trait); background: var(--carte); text-decoration: none; color: inherit; }
.lien-compte:hover, .lien-compte.actif { border-color: var(--accent); color: var(--accent); }
.ico-compte { width: 1.45em; height: 1.45em; color: var(--accent); }
.ico-chevron { width: .9em; height: .9em; opacity: .55; }
.choix-icone form.grille-icones { display: grid; grid-template-columns: repeat(2, 12rem); width: max-content; flex-wrap: nowrap; }
.choix-icone .grille-icones button span { white-space: nowrap; }
.choix-icone > summary .ico-lieu { width: 1.35em; height: 1.35em; }

/* Listes : mes listes et création côte à côte */
.listes-perso { display: grid; grid-template-columns: 1fr minmax(18rem, 24rem); gap: 1.5rem; align-items: start; }
.nouvelle-liste > summary { list-style: none; cursor: pointer; }
.nouvelle-liste > summary::-webkit-details-marker { display: none; }
.nouvelle-liste > summary h3 { display: inline; margin: 0; color: var(--accent); }
@media (max-width: 760px) { .listes-perso { grid-template-columns: 1fr; } }

/* Accueil : tableau de bord */
.chiffres { margin: .2rem 0 .4rem; color: var(--encre-douce); }
.chiffres a { color: inherit; text-decoration: none; } .chiffres a:hover { color: var(--accent); }
.chiffres strong { font-family: var(--serif); font-size: 1.3rem; color: var(--encre); }
.raccourcis { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1.2rem; }
.a-faire { background: var(--carte); border: 1px solid var(--trait); border-left: 4px solid var(--accent);
  border-radius: var(--rayon); padding: .6rem 1rem; margin-bottom: 1.4rem; }
.a-faire h3 { margin: 0 0 .3rem; font-size: 1rem; }
.a-faire ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.a-faire li.urgent a { font-weight: 600; }
.vignette-lecture { display: flex; flex-direction: column; gap: .35rem; flex: none; }
.vignette-lecture form { margin: 0; }
.vignette-lecture .bouton-lecture { font-size: .8rem; padding: .15rem .7rem; }
.presentation-site { max-width: 46rem; margin: 1rem 0 2rem; }
.presentation-site h2 { font-size: 1.8rem; margin-bottom: .5rem; }
.lien-reinitialisation { margin-bottom: 1rem; }
.lien-reinitialisation input[type=text] { width: min(100%, 42rem); font-family: monospace; font-size: .85rem; }
.historique { margin: 1rem 0; font-size: .9rem; }
.historique summary { cursor: pointer; color: var(--discret); }
.historique ul { margin: .5rem 0 0; padding-left: 1.2rem; }
.historique li { margin: .25rem 0; }
.badge-genre { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .85rem;
  background: var(--vert-clair); border: 1px solid var(--vert); color: var(--encre) !important; text-decoration: none; margin: 0 .2rem .2rem 0; }
.badge-genre:hover { filter: brightness(.97); }
.provenance-genre { font-size: .8rem; }
.modifier-genres summary { cursor: pointer; color: var(--accent); font-size: .85rem; display: inline; }
.modifier-genres form { margin-top: .5rem; }
.modifier-genres fieldset { border: none; padding: 0; margin: 0 0 .6rem; }
.modifier-genres legend { font-weight: 600; padding: 0; }
.modifier-genres fieldset > label { display: inline-block; margin: .1rem .9rem .1rem 0; font-size: .9rem; }
.onglets-portee a.actif { font-weight: 600; color: var(--encre); text-decoration: none; }
.lots-genre { margin: 1rem 0; }
.lots-genre summary { cursor: pointer; color: var(--accent); }
.lots-genre li { margin: .4rem 0; }
.a-classer { list-style: none; padding: 0; }
.a-classer > li { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid var(--trait); }
.a-classer-texte { flex: 1 1 18rem; display: flex; flex-direction: column; gap: .15rem; }
.a-classer-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.a-classer-actions select { max-width: 14rem; }
.genres-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.genre-carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: .8rem 1rem; box-shadow: var(--ombre); }
.genre-carte.vide { opacity: .6; box-shadow: none; }
.genre-carte h3 { margin: 0 0 .4rem; font-family: var(--serif); font-size: 1.1rem; }
.genre-carte h3 a { color: var(--encre); text-decoration: none; }
.genre-carte p { margin: 0; font-size: .9rem; line-height: 1.6; }
.sous-genres { margin: .5rem 0 1rem; display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.rubriques-prix { margin: .5rem 0 1rem; font-size: .9rem; line-height: 1.8; }
h3.rubrique-majeure { font-size: 1.25rem; }

/* --- Choix du thème ---------------------------------------------------------------- */

.menu-theme { position: relative; display: flex; align-items: center; margin: 0; }
.menu-theme summary { list-style: none; cursor: pointer; color: var(--encre-douce); padding: .35rem; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; line-height: 1; }
.menu-theme summary::-webkit-details-marker { display: none; }
.menu-theme summary:hover { background: var(--carte-2); color: var(--encre); }
.menu-theme summary svg { display: block; width: 1.3rem; height: 1.3rem; }
.menu-theme form { position: absolute; right: 0; top: 2.2rem; z-index: 20; display: flex; flex-direction: column; gap: .2rem;
  background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .4rem; box-shadow: var(--ombre);
  min-width: 11rem; }
.choix-theme button { display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; background: transparent;
  color: var(--encre); border: 1px solid transparent; padding: .35rem .6rem; white-space: nowrap; }
.choix-theme button:hover { background: var(--carte-2); filter: none; }
.choix-theme button[aria-pressed="true"] { border-color: var(--accent); font-weight: 600; }
.apercu-theme { display: inline-flex; border-radius: 999px; overflow: hidden; border: 1px solid var(--trait);
  background: var(--papier); }
.apercu-theme i { width: .8rem; height: 1rem; }
.apercu-theme i:nth-child(1) { background: var(--papier); } .apercu-theme i:nth-child(2) { background: var(--carte); }
.apercu-theme i:nth-child(3) { background: var(--accent); } .apercu-theme i:nth-child(4) { background: var(--encre); }
.compte-themes { display: flex; flex-wrap: wrap; gap: .5rem; }
.compte-themes button { width: auto; border: 1px solid var(--trait); }

/* --- Page auteur : ses livres (filtres, livres primés) ---------------------------------- */

.carte-livre { position: relative; }
.badge-prime { position: absolute; top: .35rem; left: .35rem; z-index: 2; font-size: .85rem; line-height: 1;
  padding: .18rem .22rem; border-radius: 4px; background: rgba(255, 250, 241, .88); box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  cursor: help; }
.filtres-livres { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin: .2rem 0 1rem; font-size: .9rem; }
.filtres-livres[hidden], .carte-livre[hidden] { display: none; }
.choix-langue { display: inline-flex; }
.choix-langue button { background: transparent; color: var(--encre-douce); border: 1px solid var(--trait); border-radius: 0;
  margin-left: -1px; padding: .25rem .8rem; font-size: .88rem; }
.choix-langue button:first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
.choix-langue button:last-child { border-radius: 0 999px 999px 0; }
.choix-langue button[aria-pressed="true"] { background: var(--accent-clair); color: var(--accent); border-color: var(--accent);
  position: relative; font-weight: 600; }
.filtres-livres select { padding: .25rem .5rem; font-size: .88rem; }
#voir-tout { margin: 1rem 0; }

/* --- Notifications ------------------------------------------------------------------- */

.cloche { position: relative; display: flex !important; align-items: center; padding: .35rem !important; }
.cloche svg { display: block; width: 1.3rem; height: 1.3rem; }
.cloche .pastille-compte { position: absolute; top: -.1rem; right: -.25rem; font-size: .65rem; }
.notifications { list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.notification a { display: flex; gap: .9rem; align-items: center; padding: .7rem .9rem; border-bottom: 1px solid var(--trait);
  color: var(--encre); text-decoration: none; border-radius: var(--rayon); }
.notification a:hover { background: var(--carte-2); }
.notification.nouvelle a { background: var(--accent-clair); }
.notification img { width: 36px; height: 54px; object-fit: cover; border-radius: 2px 4px 4px 2px; box-shadow: var(--ombre-livre); flex: none; }
.icone-notification { width: 36px; text-align: center; font-size: 1.4rem; flex: none; }
.texte-notification { display: flex; flex-direction: column; gap: .1rem; }

/* --- Partage public (vitrine) ------------------------------------------------------- */

.lien-partage { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0 .6rem; }
.lien-partage input { flex: 1 1 22rem; font-size: .9rem; }
#filtres-vitrine input[type=search] { flex: 1 1 16rem; max-width: 24rem; }

/* --- Pièces (au-dessus des emplacements) ------------------------------------------------ */

.piece-lieu { color: var(--discret); }
.lieux.pieces { margin-bottom: .3rem; }
.lieux.pieces > span { align-self: center; margin-right: .2rem; }
.titre-piece { margin: 1.4rem 0 .5rem; }
.lieux-table tr.ligne-piece th { text-align: left; font-family: var(--serif); font-size: 1.05rem; padding-top: 1rem;
  border-bottom: 1px solid var(--trait); }
.pieces-liste { list-style: none; padding: 0; margin: .4rem 0 .8rem; }
.pieces-liste li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .3rem 0; }
.piece-de-lieu { margin: .2rem 0; }
.lieux-table select[name=piece] { min-width: 8rem; }
.pieces-liste form.inline { display: inline-flex; gap: .4rem; align-items: center; }
.pieces-liste input[type=text] { width: 14rem; }
