/* Biblioche — système de design.
 *
 * Inspiré d'iOS : fond gris clair, listes groupées blanches aux coins
 * arrondis, grands titres, barre d'onglets en bas sur téléphone (colonne à
 * gauche sur ordinateur), cartes qui montent du bas. Clair par défaut, sombre
 * si l'appareil l'est. Police système pour l'interface ; Literata (servie par
 * le site) pour les titres de livres. Un seul accent, orange « reliure ».
 * Cibles tactiles de 44 px, focus toujours visible, contrastes AA au moins.
 */

@font-face {
  font-family: "Literata";
  src: url("../polices/literata-latin-wght-normal.3dfc6740cd53.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("../polices/literata-latin-wght-italic.171ab726ef88.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../polices/atkinson-hyperlegible-next-latin-wght-normal.825fabef695f.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

:root {
  /* Clair. Contrastes calculés : texte 16:1, texte secondaire 6:1 sur blanc
     et 5,3:1 sur le fond gris, accent 5,1:1 au moins (6,2:1 sur blanc),
     bordures de champs 3,6:1. */
  color-scheme: light dark;

  --papier: #f2f2f7; /* fond groupé */
  --surface: #ffffff;
  --surface-2: #e9e9ef; /* remplissage des champs, segments */
  --encre: #1c1c1e;
  --encre-douce: #636368;
  --filet: #dcdce1;
  --filet-fort: #c7c7cc;
  --bord-champ: #86868b;
  --voile: rgb(0 0 0 / 0.38);

  --accent: #ad3a0b;
  --accent-fonce: #8a2d08;
  --accent-pale: #fff0e5;
  --sur-accent: #ffffff;

  --vert: #1d7a4b;
  --vert-pale: #e2f4ea;
  --retard: #c0322b;
  --retard-pale: #fde8e6;
  --attention: #8a5a00;
  --attention-pale: #fff3d1;
  --orange: #b45f00; /* une limite (formule gratuite) : 4,6:1 sur blanc */

  --bois: #8b6a4a;

  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Atkinson Hyperlegible Next",
    "Helvetica Neue", Arial, sans-serif;
  --titre: "Literata", Georgia, "Times New Roman", serif;

  --t-petit: 0.8125rem;
  --t-base: 1.0625rem;
  --t-moyen: 1.25rem;
  --t-grand: 1.5rem;
  --t-titre: 2.125rem;

  --espace-1: 0.25rem;
  --espace-2: 0.5rem;
  --espace-3: 0.75rem;
  --espace-4: 1rem;
  --espace-5: 1.5rem;
  --espace-6: 2rem;
  --espace-7: 3rem;

  --rayon: 12px;
  --rayon-petit: 8px;
  --cible: 2.75rem; /* 44 px */
  --largeur: 64rem;
  --largeur-etroite: 40rem;
  --onglets: 4.25rem; /* hauteur de la barre d'onglets sur téléphone */
  --ombre: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Les gris chauds et la dorure du premier thème, fond un peu éclairci.
       Contrastes : texte 14:1, texte secondaire 6,4:1, accent 7,6:1. */
    --papier: #131210;
    --surface: #1e1c19;
    --surface-2: #2a2723;
    --encre: #eee8dc;
    --encre-douce: #aaa295;
    --filet: #34302b;
    --filet-fort: #47423c;
    --bord-champ: #7d766b;
    --voile: rgb(0 0 0 / 0.55);

    --accent: #d9ab52;
    --accent-fonce: #ecc77c;
    --accent-pale: #352a18;
    --sur-accent: #131210;

    --vert: #7cc8a0;
    --vert-pale: #1d3027;
    --retard: #ef8a7a;
    --retard-pale: #3a201c;
    --attention: #e5b567;
    --attention-pale: #352a1b;
    --orange: #ffa53d;

    --bois: #5e4a37;
    --ombre: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.45);
  }
}

/* --- Socle ----------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* `hidden` doit gagner sur tout `display` posé par un composant. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 var(--t-base) / 1.47 var(--texte);
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: var(--espace-6) 0 var(--espace-3);
  text-wrap: balance;
}
h1 {
  font-size: var(--t-titre);
  margin-top: var(--espace-2);
}
h2 {
  font-size: var(--t-grand);
}
h3 {
  font-size: var(--t-moyen);
}
p,
ul,
ol,
dl {
  margin: 0 0 var(--espace-4);
}
img {
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
/* Un lien au milieu d'un texte reste souligné : il doit se voir sans la couleur. */
p a,
dd a,
.chapeau a,
.juridique li > a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visuellement-cache {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.discret {
  color: var(--encre-douce);
}
.petit {
  font-size: var(--t-petit);
}
.chapeau {
  font-size: var(--t-moyen);
  color: var(--encre-douce);
  max-width: 42rem;
}

/* --- Ossature ---------------------------------------------------------------- */

.evitement {
  position: absolute;
  left: var(--espace-4);
  top: -4rem;
  z-index: 100;
  padding: var(--espace-2) var(--espace-4);
  background: var(--accent);
  color: var(--sur-accent);
  border-radius: var(--rayon-petit);
}
.evitement:focus {
  top: var(--espace-2);
}

.bandeau-env {
  padding: 0.15rem var(--espace-4);
  background: var(--attention-pale);
  color: var(--attention);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* En-tête des pages publiques (présentation, connexion, pages juridiques). */
.entete {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--papier) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--filet);
}
.entete-haut {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--espace-2) var(--espace-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2) var(--espace-5);
  align-items: center;
  justify-content: space-between;
}
.marque {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: var(--cible);
  color: var(--encre);
  font-family: var(--titre);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}
.marque::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  background:
    linear-gradient(90deg, var(--accent) 0 40%, transparent 40% 55%, var(--accent) 55% 100%);
}
.marque:hover {
  text-decoration: none;
}
.compte {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2) var(--espace-4);
  align-items: center;
  font-size: 0.9375rem;
}
.compte a {
  color: var(--encre);
}
.compte a.bouton {
  color: var(--sur-accent);
}

/* Contenu */
.contenu {
  flex: 1;
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--espace-4) var(--espace-4) var(--espace-7);
}
.etroit {
  max-width: var(--largeur-etroite);
}

.pied {
  color: var(--encre-douce);
  font-size: var(--t-petit);
}
.pied-dedans {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--espace-5) var(--espace-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2) var(--espace-5);
  justify-content: space-between;
}
.pied-liens {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2) var(--espace-4);
}
.pied-liens a {
  color: var(--encre-douce);
}

/* --- Application : barre d'onglets ------------------------------------------------ */

.onglets {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--filet);
  padding-bottom: env(safe-area-inset-bottom);
}
.onglets ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 40rem;
}
.onglets a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3.25rem;
  padding: 0.35rem 0 0.25rem;
  color: var(--encre-douce);
  font-size: 0.6875rem;
  font-weight: 600;
  text-decoration: none;
}
.onglets a[aria-current="page"] {
  color: var(--accent);
}
.onglets svg {
  width: 1.6rem;
  height: 1.6rem;
}
.app .contenu {
  padding-bottom: calc(var(--onglets) + var(--espace-6) + env(safe-area-inset-bottom));
}
.app .pied {
  display: none;
}

/* Sur ordinateur, les onglets deviennent une colonne à gauche. */
@media (min-width: 60rem) {
  .app {
    padding-left: 15rem;
  }
  .onglets {
    top: 0;
    bottom: 0;
    right: auto;
    width: 15rem;
    border-top: 0;
    border-right: 1px solid var(--filet);
    background: var(--surface);
    backdrop-filter: none;
    padding: var(--espace-4) var(--espace-3);
  }
  .onglets .marque {
    padding: 0 var(--espace-3) var(--espace-4);
  }
  .onglets ul {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }
  .onglets a {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--espace-3);
    min-height: var(--cible);
    padding: 0 var(--espace-3);
    border-radius: var(--rayon-petit);
    color: var(--encre);
    font-size: var(--t-base);
    font-weight: 500;
  }
  .onglets a:hover {
    background: var(--surface-2);
  }
  .onglets a[aria-current="page"] {
    background: var(--accent-pale);
    color: var(--accent);
  }
  .onglets svg {
    width: 1.35rem;
    height: 1.35rem;
  }
  .app .contenu {
    padding: var(--espace-6) var(--espace-6) var(--espace-7);
  }
  .app .pied {
    display: block;
  }
}
@media (max-width: 59.99rem) {
  .onglets .marque {
    display: none;
  }
}

/* --- En-tête de page : retour, grand titre, action --------------------------------- */

.barre-page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  min-height: var(--cible);
}
.retour {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: var(--cible);
  margin-left: -0.35rem;
  font-size: var(--t-base);
}
.retour::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 0.4rem;
}
.retour:hover {
  text-decoration: none;
}
.grand-titre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  margin: var(--espace-2) 0 var(--espace-4);
}
.grand-titre h1 {
  margin: 0;
}

/* --- Boutons --------------------------------------------------------------------- */

button,
.bouton,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-2);
  min-height: var(--cible);
  padding: 0 var(--espace-5);
  font: 600 var(--t-base) / 1.2 var(--texte);
  color: var(--sur-accent);
  background: var(--accent);
  border: 0;
  border-radius: var(--rayon);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 120ms ease,
    transform 120ms ease;
}
button:hover,
.bouton:hover {
  background: var(--accent-fonce);
  color: var(--sur-accent);
  text-decoration: none;
}
button:active,
.bouton:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Bouton secondaire teinté (comme iOS) : se détache du fond gris comme du blanc. */
.secondaire,
.bouton.secondaire {
  background: var(--accent-pale);
  color: var(--accent-fonce);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.secondaire:hover,
.bouton.secondaire:hover {
  background: color-mix(in srgb, var(--accent) 18%, var(--accent-pale));
  color: var(--accent-fonce);
}
button.lien,
.bouton-texte {
  min-height: auto;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 400;
  border-radius: 0;
}
button.lien:hover,
.bouton-texte:hover {
  background: none;
  color: var(--accent-fonce);
  text-decoration: underline;
}
button.danger,
.danger button,
.bouton.danger {
  background: var(--retard);
  color: #fff;
}
button.danger:hover,
.danger button:hover {
  background: var(--retard);
  filter: brightness(0.92);
}
.plein {
  width: 100%;
}
.grand-bouton {
  min-height: 3.25rem;
  padding: 0 var(--espace-6);
  font-size: var(--t-moyen);
}
.petit-bouton {
  min-height: 2.25rem;
  padding: 0 var(--espace-4);
  font-size: 0.9375rem;
}
.rond {
  width: var(--cible);
  min-width: var(--cible);
  padding: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-3);
  align-items: center;
}
.en-ligne {
  display: inline;
}

/* --- Champs ------------------------------------------------------------------------ */

label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: var(--espace-1);
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input:not([type]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: var(--cible);
  padding: 0.6rem var(--espace-3);
  font: inherit;
  color: var(--encre);
  background: var(--surface);
  border: 1px solid var(--bord-champ);
  border-radius: var(--rayon-petit);
  appearance: none;
}
select {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.75rem;
}
textarea {
  min-height: 6rem;
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--accent);
  vertical-align: -0.25rem;
  margin: 0 0.4rem 0 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--encre-douce);
  opacity: 1;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 0;
  border-color: var(--accent);
}
.helptext {
  display: block;
  margin-top: var(--espace-1);
  font-size: var(--t-petit);
  color: var(--encre-douce);
}
.errorlist {
  list-style: none;
  margin: var(--espace-1) 0;
  padding: 0;
  color: var(--retard);
  font-size: 0.9375rem;
  font-weight: 600;
}
.erreur {
  color: var(--retard);
  font-weight: 600;
}

/* Formulaire « à la Réglages » : des champs groupés, l'étiquette au-dessus. */
form > div,
.champs > div {
  margin-bottom: var(--espace-4);
}
.cote-a-cote {
  display: grid;
  grid-template-columns: 1fr 7.5rem;
  gap: var(--espace-3);
}
.cote-a-cote > div {
  margin: 0;
}

/* Champ de recherche arrondi, loupe dessinée. */
.recherche-champ {
  position: relative;
  margin: 0 0 var(--espace-4);
}
.recherche-champ input {
  min-height: 2.6rem;
  padding-left: 2.35rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='6' fill='none' stroke='%2386868b' stroke-width='2'/%3E%3Cpath d='M13 13l5 5' stroke='%2386868b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
      no-repeat 0.8rem center / 1rem,
    var(--surface-2);
  border-color: transparent;
  border-radius: var(--rayon-petit);
}

/* Contrôle segmenté : des liens ou des boutons, l'état courant en relief. */
.segments {
  display: flex;
  gap: 2px;
  padding: 2px;
  margin: 0 0 var(--espace-4);
  background: var(--surface-2);
  border-radius: 9px;
  overflow-x: auto;
  scrollbar-width: none;
}
.segments > a,
.segments > button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 var(--espace-3);
  border-radius: 7px;
  background: none;
  color: var(--encre);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.segments > a:hover,
.segments > button:hover {
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  color: var(--encre);
  text-decoration: none;
}
/* Le choix courant, plein d'accent : on le voit du premier coup d'œil. */
.segments > [aria-current="page"],
.segments > [aria-pressed="true"],
.segments > [aria-current="page"]:hover,
.segments > [aria-pressed="true"]:hover {
  background: var(--accent);
  color: var(--sur-accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
}
.segments > button:active {
  transform: none;
}

/* --- Listes groupées (comme les Réglages) ------------------------------------------- */

.groupe-titre {
  margin: var(--espace-5) var(--espace-4) var(--espace-2);
  font-size: var(--t-petit);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--encre-douce);
}
.groupe {
  list-style: none;
  margin: 0 0 var(--espace-2);
  padding: 0;
  background: var(--surface);
  border-radius: var(--rayon);
  overflow: hidden;
}
.groupe > li,
.groupe > .ligne {
  position: relative;
}
.groupe > li + li::before,
.groupe > .ligne + .ligne::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--espace-4);
  right: 0;
  border-top: 1px solid var(--filet);
}
.ligne,
.groupe > li > a,
.groupe > li > .ligne-contenu,
.groupe > li > button.ligne-bouton,
.groupe > li > form > button.ligne-bouton {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  width: 100%;
  min-height: var(--cible);
  padding: 0.65rem var(--espace-4);
  color: var(--encre);
  background: none;
  border-radius: 0;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.groupe > li > a:hover,
.groupe > li > button.ligne-bouton:hover,
.groupe > li > form > button.ligne-bouton:hover {
  background: var(--surface-2);
  color: var(--encre);
  text-decoration: none;
}
.chevron {
  display: flex;
  margin-left: auto;
}
.groupe > li > a::after,
.chevron::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-top: 2px solid var(--filet-fort);
  border-right: 2px solid var(--filet-fort);
  transform: rotate(45deg);
}
.ligne-libelle {
  flex: 1;
  min-width: 0;
}
.ligne-libelle small {
  display: block;
  color: var(--encre-douce);
  font-size: var(--t-petit);
}
.ligne-valeur {
  color: var(--encre-douce);
  text-align: right;
}
.groupe .accent,
.groupe button.ligne-bouton.accent {
  color: var(--accent);
}
.groupe .rouge,
.groupe button.ligne-bouton.rouge {
  color: var(--retard);
}
.groupe-note {
  margin: 0 var(--espace-4) var(--espace-4);
  font-size: var(--t-petit);
  color: var(--encre-douce);
}
.groupe form {
  margin: 0;
}
.groupe .ligne-formulaire {
  display: flex;
  gap: var(--espace-2);
  align-items: center;
  padding: var(--espace-2) var(--espace-3) var(--espace-2) var(--espace-4);
}
.groupe .ligne-formulaire input {
  flex: 1;
  min-width: 0;
  border-color: transparent;
  background: var(--surface-2);
}

/* Fiche descriptive (définitions) : en lignes de groupe. */
.groupe dl,
dl.groupe {
  margin: 0;
}
.details-ligne {
  display: flex;
  gap: var(--espace-4);
  justify-content: space-between;
  padding: 0.65rem var(--espace-4);
  position: relative;
}
.details-ligne + .details-ligne::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--espace-4);
  right: 0;
  border-top: 1px solid var(--filet);
}
.details-ligne dt {
  color: var(--encre-douce);
}
.details-ligne dd {
  margin: 0;
  text-align: right;
}

/* --- Messages : bulles qui apparaissent en haut puis s'effacent ---------------------- */

.toasts {
  position: fixed;
  z-index: 60;
  top: var(--espace-3);
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 30rem);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--espace-2);
}
.toasts li {
  padding: 0.7rem var(--espace-4);
  background: var(--surface);
  color: var(--encre);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  font-weight: 500;
  animation: arriver 260ms ease-out;
}
.toasts .message-success::before {
  content: "✓ ";
  color: var(--vert);
  font-weight: 700;
}
.toasts .message-error,
.toasts .message-warning {
  color: var(--retard);
}
.toasts li.partir {
  opacity: 0;
  transform: translateY(-0.5rem);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}
@keyframes arriver {
  from {
    opacity: 0;
    transform: translateY(-0.75rem);
  }
}

/* --- Cartes qui montent du bas (dialog) -------------------------------------------------- */

dialog.feuille {
  width: 100%;
  max-width: 34rem;
  max-height: 92vh;
  margin: auto auto 0;
  padding: var(--espace-2) var(--espace-5) calc(var(--espace-5) + env(safe-area-inset-bottom));
  color: var(--encre);
  background: var(--papier);
  border: 0;
  border-radius: 14px 14px 0 0;
  box-shadow: var(--ombre);
  overflow-y: auto;
}
dialog.feuille[open] {
  animation: monter 280ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
dialog.feuille::backdrop {
  background: var(--voile);
}
@keyframes monter {
  from {
    transform: translateY(100%);
  }
}
@media (min-width: 40rem) {
  dialog.feuille {
    margin: auto;
    border-radius: 14px;
  }
  dialog.feuille[open] {
    animation: apparaitre 200ms ease-out;
  }
  @keyframes apparaitre {
    from {
      opacity: 0;
      transform: scale(0.96);
    }
  }
}
.feuille-poignee {
  width: 2.25rem;
  height: 0.3rem;
  margin: 0 auto var(--espace-3);
  border-radius: 999px;
  background: var(--filet-fort);
}
.feuille-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  margin-bottom: var(--espace-4);
}
.feuille-tete h2 {
  margin: 0;
  font-size: var(--t-moyen);
}

/* --- Livres : jaquettes et mur ------------------------------------------------------------ */

.mur {
  list-style: none;
  margin: 0 0 var(--espace-5);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr));
  gap: var(--espace-5) var(--espace-4);
}
@media (min-width: 40rem) {
  .mur {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  }
}
.carte-livre {
  container-type: inline-size;
  min-width: 0;
}
.legende {
  margin-top: var(--espace-2);
  font-size: var(--t-petit);
  line-height: 1.3;
}
.legende strong {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legende span {
  display: block;
  color: var(--encre-douce);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jaquette {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  background: var(--teinte, #3b3328);
  color: #f4ecdc;
  text-decoration: none !important;
  box-shadow:
    inset 5px 0 0 rgb(0 0 0 / 0.18),
    0 1px 2px rgb(0 0 0 / 0.15),
    0 6px 16px rgb(0 0 0 / 0.14);
  transition: transform 160ms ease;
}
a:hover > .jaquette,
.jaquette:hover {
  transform: translateY(-2px);
}
.jaquette-repli {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14% 10% 12% 16%;
}
.jaquette-titre {
  font-family: var(--titre);
  font-weight: 650;
  font-size: clamp(0.6rem, 11cqi, 1.15rem);
  line-height: 1.15;
  /* Couper un mot seulement s'il ne tient pas seul (« Germinal », pas « Germin-al »). */
  overflow-wrap: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jaquette-auteur {
  font-size: clamp(0.55rem, 7cqi, 0.75rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
.jaquette img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 260ms ease;
}
.jaquette.avec-image img {
  opacity: 1;
}
.jaquette .badge {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 1;
}

/* Toiles de reliure : la teinte vient d'une empreinte du titre (stable). */
.teinte-0 { --teinte: #6b2f2a; }
.teinte-1 { --teinte: #2d5244; }
.teinte-2 { --teinte: #2c3f5e; }
.teinte-3 { --teinte: #6a5527; }
.teinte-4 { --teinte: #533150; }
.teinte-5 { --teinte: #3c4f63; }
.teinte-6 { --teinte: #5c3b26; }
.teinte-7 { --teinte: #33493a; }

/* Étiquettes */
.etiquette {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--encre-douce);
  background: var(--surface-2);
  border-radius: 999px;
}
.etiquette.dispo {
  background: var(--vert-pale);
  color: var(--vert);
}
.etiquette.sorti {
  background: var(--attention-pale);
  color: var(--attention);
}
.etiquette.retard {
  background: var(--retard-pale);
  color: var(--retard);
}

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

.fiche-tete {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: var(--espace-5);
  align-items: end;
  margin: var(--espace-2) 0 var(--espace-5);
}
@media (min-width: 40rem) {
  .fiche-tete {
    grid-template-columns: 10rem 1fr;
  }
}
.fiche-tete h1 {
  margin: 0 0 var(--espace-1);
  font-family: var(--titre);
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  letter-spacing: -0.01em;
}
.fiche-tete .sous-titre {
  margin: 0 0 var(--espace-2);
  color: var(--encre-douce);
  font-family: var(--titre);
  font-style: italic;
}
.fiche-tete .auteurs {
  margin: 0;
  font-size: var(--t-moyen);
}
.resume {
  padding: var(--espace-3) var(--espace-4);
  margin: 0;
  line-height: 1.55;
}

/* --- États vides, encadrés --------------------------------------------------------------- */

.vide {
  margin: var(--espace-7) auto;
  max-width: 26rem;
  text-align: center;
}
.vide svg {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--filet-fort);
}
.vide h2 {
  margin: var(--espace-3) 0 var(--espace-2);
}
.vide p {
  color: var(--encre-douce);
}

.encadre {
  margin: 0 0 var(--espace-4);
  padding: var(--espace-4);
  background: var(--surface);
  border-radius: var(--rayon);
}
.encadre h2 {
  margin: 0 0 var(--espace-2);
  font-size: var(--t-moyen);
}
.encadre > :last-child {
  margin-bottom: 0;
}
.encadre.attention {
  background: var(--attention-pale);
}
.encadre.accent {
  background: var(--accent-pale);
}

.compteur {
  margin: 0 0 var(--espace-4);
  color: var(--encre-douce);
  font-size: 0.9375rem;
}

/* --- Bibliothèques (meubles) et étagères ---------------------------------------------------- */

.meubles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--espace-4);
  margin: 0 0 var(--espace-5);
}
.meuble {
  padding: var(--espace-3) var(--espace-4) var(--espace-2);
  background: var(--surface);
  border-radius: var(--rayon);
}
.meuble-tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--espace-3);
}
.meuble-tete h2 {
  margin: var(--espace-1) 0 var(--espace-2);
  font-size: var(--t-moyen);
}
.meuble-tete h2 a {
  color: var(--encre);
}
.etageres {
  list-style: none;
  padding: 0;
  margin: var(--espace-2) 0;
  border: 5px solid var(--bois);
  border-radius: 4px;
}
.etageres li + li {
  border-top: 4px solid var(--bois);
}
.etageres a {
  display: grid;
  grid-template-columns: 5.25rem 1fr auto;
  gap: var(--espace-2);
  align-items: end;
  min-height: var(--cible);
  padding: 0.3rem var(--espace-2) 0;
  color: var(--encre);
  text-decoration: none;
  font-size: var(--t-petit);
}
.etageres a:hover {
  background: var(--accent-pale);
  text-decoration: none;
}
.dos {
  display: flex;
  gap: 2px;
  align-items: end;
  overflow: hidden;
  height: 1.9rem;
}
.dos i {
  display: block;
  width: 0.45rem;
  height: 100%;
  border-radius: 1px 1px 0 0;
  background: var(--accent);
  opacity: 0.8;
}
.dos i:nth-child(3n) {
  height: 84%;
  background: var(--vert);
}
.dos i:nth-child(4n + 1) {
  height: 92%;
  opacity: 0.55;
}

/* --- Scanner ------------------------------------------------------------------------------ */

.scanner-image {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
}
.scanner-image:empty,
.scanner-image:has(video[hidden]):not(:has(canvas)) {
  display: grid;
  place-items: center;
}
.scanner-image video,
.scanner-image canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Le cadre de visée, dessiné au-dessus de l'image. */
.scanner-image::after {
  content: "";
  position: absolute;
  inset: 30% 12%;
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgb(0 0 0 / 0.25);
  background:
    linear-gradient(#fff, #fff) top left / 1.5rem 3px,
    linear-gradient(#fff, #fff) top left / 3px 1.5rem,
    linear-gradient(#fff, #fff) top right / 1.5rem 3px,
    linear-gradient(#fff, #fff) top right / 3px 1.5rem,
    linear-gradient(#fff, #fff) bottom left / 1.5rem 3px,
    linear-gradient(#fff, #fff) bottom left / 3px 1.5rem,
    linear-gradient(#fff, #fff) bottom right / 1.5rem 3px,
    linear-gradient(#fff, #fff) bottom right / 3px 1.5rem;
  background-repeat: no-repeat;
  pointer-events: none;
}
.scanner-etat {
  margin: var(--espace-3) 0;
  min-height: 1.5em;
  color: var(--encre-douce);
  text-align: center;
}
.scanner-commandes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
  justify-content: center;
}
.scanner-commandes select {
  width: auto;
}
.saisie-isbn {
  display: flex;
  gap: var(--espace-2);
  margin: var(--espace-4) 0;
}
.saisie-isbn input {
  flex: 1;
  min-width: 0;
}

/* Résultat d'un scan, dans la carte qui monte. */
.trouve {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: var(--espace-4);
  align-items: center;
  margin-bottom: var(--espace-4);
}
.trouve-titre {
  margin: 0;
  font-family: var(--titre);
  font-size: var(--t-moyen);
  font-weight: 650;
  line-height: 1.25;
}
.trouve-auteurs {
  margin: 0.15rem 0 0;
  color: var(--encre-douce);
}
.trouve .etiquette {
  margin-top: var(--espace-2);
}

/* File du scan en série */
.file {
  list-style: none;
  margin: 0 0 var(--espace-4);
  padding: 0;
  background: var(--surface);
  border-radius: var(--rayon);
  overflow: hidden;
}
.file-ligne {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2) var(--espace-3);
  align-items: center;
  padding: 0.65rem var(--espace-4);
}
.file-ligne + .file-ligne::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--espace-4);
  right: 0;
  border-top: 1px solid var(--filet);
}
.file-corps {
  flex: 1 1 14rem;
  min-width: 0;
}
.file-corps input {
  min-height: 2.4rem;
}
.file-nombre {
  display: inline-flex;
  align-items: center;
  gap: var(--espace-2);
  white-space: nowrap;
}
.file-nombre button.lien {
  min-width: 2rem;
  min-height: 2rem;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  font-weight: 700;
  text-decoration: none;
}
.barre-enregistrer {
  position: fixed;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: calc(var(--onglets) + env(safe-area-inset-bottom));
  padding: var(--espace-3) var(--espace-4);
  background: color-mix(in srgb, var(--papier) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--filet);
  display: flex;
  justify-content: center;
}
.barre-enregistrer button {
  width: min(100%, 30rem);
}
@media (min-width: 60rem) {
  .barre-enregistrer {
    left: 15rem;
    bottom: 0;
  }
}

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

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--espace-3);
  margin: var(--espace-5) 0;
}

.sondage .choix {
  border: 0;
  margin: 0 0 var(--espace-3);
  padding: 0;
  display: grid;
  gap: var(--espace-2);
}
.sondage .choix label,
label.case {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  font-weight: 400;
  margin: 0;
  min-height: var(--cible);
}
.montant input {
  max-width: 8rem;
}

/* Pages juridiques : un texte long, à lire. */
.juridique {
  max-width: 44rem;
}
.juridique h2 {
  margin-top: var(--espace-6);
  font-size: var(--t-moyen);
}
.juridique h3 {
  margin: var(--espace-5) 0 0;
  font-size: var(--t-base);
}
.juridique li + li {
  margin-top: var(--espace-1);
}
.juridique .fiche {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--espace-2) var(--espace-5);
  margin: var(--espace-2) 0 var(--espace-4);
}
.juridique .fiche dt {
  color: var(--encre-douce);
}
.juridique .fiche dd {
  margin: 0;
}
@media (max-width: 30rem) {
  .juridique .fiche {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .juridique .fiche dd {
    margin-bottom: var(--espace-2);
  }
}
.a-completer {
  color: var(--attention);
  font-style: italic;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--surface);
  border-radius: var(--rayon);
  overflow: hidden;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--espace-3);
  border-bottom: 1px solid var(--filet);
}
th {
  font-size: var(--t-petit);
  font-weight: 600;
  color: var(--encre-douce);
}
.defilement {
  overflow-x: auto;
  margin: var(--espace-4) 0;
}

details > summary {
  cursor: pointer;
  color: var(--accent);
  min-height: var(--cible);
  display: flex;
  align-items: center;
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}
details[open] > summary::after {
  transform: rotate(-135deg);
}

/* Les pages publiques gardent une largeur de lecture. */
.carte-connexion {
  max-width: 26rem;
  margin: var(--espace-5) auto;
  padding: var(--espace-5);
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--ombre);
}
.carte-connexion h1 {
  font-size: var(--t-grand);
}
.carte-connexion button[type="submit"] {
  width: 100%;
}

@media (max-width: 36rem) {
  :root {
    --t-titre: 1.875rem;
    --t-grand: 1.375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .entete,
  .onglets,
  .pied,
  .barre-enregistrer,
  .actions,
  form {
    display: none !important;
  }
  .app {
    padding: 0;
  }
}

/* Recherche et filtres de « Livres » */
.filtrer {
  margin-bottom: var(--espace-3);
}
.filtrer .recherche-champ {
  margin-bottom: var(--espace-3);
}
.pastilles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
  align-items: center;
}
.pastilles select.actif {
  background-color: var(--accent);
  color: var(--sur-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.pastilles select {
  width: auto;
  min-height: 2.25rem;
  padding: 0 2rem 0 var(--espace-3);
  border: 0;
  border-radius: 999px;
  background-color: var(--surface-2);
  font-size: 0.9375rem;
  font-weight: 500;
}
.espace-haut {
  margin-top: var(--espace-6);
}
button.rouge-texte {
  color: var(--retard);
}
.plus-de-details {
  margin: var(--espace-4) 0;
}
.pied-formulaire {
  flex-direction: column;
  align-items: stretch;
  margin-top: var(--espace-5);
}
.en-erreur input,
.en-erreur select,
.en-erreur textarea {
  border-color: var(--retard);
}
.ou-il-est {
  margin: 0 0 var(--espace-4);
  font-size: var(--t-grand);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.reussite {
  font-size: var(--t-moyen);
}
.mini-jaquette {
  flex: none;
  width: 2.5rem;
  container-type: inline-size;
}
.mini-jaquette .jaquette-repli {
  padding: 10% 8% 8% 14%;
}
.mini-jaquette .jaquette-auteur {
  display: none;
}
.contenu.carte-connexion {
  flex: 0 0 auto;
  margin-top: var(--espace-6);
  margin-bottom: var(--espace-6);
}
.carte-connexion form p,
.carte-connexion form > div {
  margin-bottom: var(--espace-4);
}
.onglets a:hover,
.marque:hover,
.etageres a:hover {
  text-decoration: none;
}

/* --- Abonnement ------------------------------------------------------------------ */

.formule-nom {
  margin: 0 0 var(--espace-3);
  font-size: var(--t-grand);
  font-weight: 700;
}
.jauge + .jauge {
  margin-top: var(--espace-3);
}
.jauge-tete {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--espace-1);
  font-size: 0.9375rem;
}
.jauge-barre {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.jauge-barre span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--vert);
}
.jauge-barre.presque span {
  background: var(--attention);
}
.jauge-barre.pleine span {
  background: var(--retard);
}
/* Largeurs de jauge en classes : la CSP refuse les styles en ligne. */
.largeur-0 { width: 0%; }
.largeur-1 { width: 1%; }
.largeur-2 { width: 2%; }
.largeur-3 { width: 3%; }
.largeur-4 { width: 4%; }
.largeur-5 { width: 5%; }
.largeur-6 { width: 6%; }
.largeur-7 { width: 7%; }
.largeur-8 { width: 8%; }
.largeur-9 { width: 9%; }
.largeur-10 { width: 10%; }
.largeur-11 { width: 11%; }
.largeur-12 { width: 12%; }
.largeur-13 { width: 13%; }
.largeur-14 { width: 14%; }
.largeur-15 { width: 15%; }
.largeur-16 { width: 16%; }
.largeur-17 { width: 17%; }
.largeur-18 { width: 18%; }
.largeur-19 { width: 19%; }
.largeur-20 { width: 20%; }
.largeur-21 { width: 21%; }
.largeur-22 { width: 22%; }
.largeur-23 { width: 23%; }
.largeur-24 { width: 24%; }
.largeur-25 { width: 25%; }
.largeur-26 { width: 26%; }
.largeur-27 { width: 27%; }
.largeur-28 { width: 28%; }
.largeur-29 { width: 29%; }
.largeur-30 { width: 30%; }
.largeur-31 { width: 31%; }
.largeur-32 { width: 32%; }
.largeur-33 { width: 33%; }
.largeur-34 { width: 34%; }
.largeur-35 { width: 35%; }
.largeur-36 { width: 36%; }
.largeur-37 { width: 37%; }
.largeur-38 { width: 38%; }
.largeur-39 { width: 39%; }
.largeur-40 { width: 40%; }
.largeur-41 { width: 41%; }
.largeur-42 { width: 42%; }
.largeur-43 { width: 43%; }
.largeur-44 { width: 44%; }
.largeur-45 { width: 45%; }
.largeur-46 { width: 46%; }
.largeur-47 { width: 47%; }
.largeur-48 { width: 48%; }
.largeur-49 { width: 49%; }
.largeur-50 { width: 50%; }
.largeur-51 { width: 51%; }
.largeur-52 { width: 52%; }
.largeur-53 { width: 53%; }
.largeur-54 { width: 54%; }
.largeur-55 { width: 55%; }
.largeur-56 { width: 56%; }
.largeur-57 { width: 57%; }
.largeur-58 { width: 58%; }
.largeur-59 { width: 59%; }
.largeur-60 { width: 60%; }
.largeur-61 { width: 61%; }
.largeur-62 { width: 62%; }
.largeur-63 { width: 63%; }
.largeur-64 { width: 64%; }
.largeur-65 { width: 65%; }
.largeur-66 { width: 66%; }
.largeur-67 { width: 67%; }
.largeur-68 { width: 68%; }
.largeur-69 { width: 69%; }
.largeur-70 { width: 70%; }
.largeur-71 { width: 71%; }
.largeur-72 { width: 72%; }
.largeur-73 { width: 73%; }
.largeur-74 { width: 74%; }
.largeur-75 { width: 75%; }
.largeur-76 { width: 76%; }
.largeur-77 { width: 77%; }
.largeur-78 { width: 78%; }
.largeur-79 { width: 79%; }
.largeur-80 { width: 80%; }
.largeur-81 { width: 81%; }
.largeur-82 { width: 82%; }
.largeur-83 { width: 83%; }
.largeur-84 { width: 84%; }
.largeur-85 { width: 85%; }
.largeur-86 { width: 86%; }
.largeur-87 { width: 87%; }
.largeur-88 { width: 88%; }
.largeur-89 { width: 89%; }
.largeur-90 { width: 90%; }
.largeur-91 { width: 91%; }
.largeur-92 { width: 92%; }
.largeur-93 { width: 93%; }
.largeur-94 { width: 94%; }
.largeur-95 { width: 95%; }
.largeur-96 { width: 96%; }
.largeur-97 { width: 97%; }
.largeur-98 { width: 98%; }
.largeur-99 { width: 99%; }
.largeur-100 { width: 100%; }
.choix-periode {
  display: grid;
  gap: var(--espace-3);
}
button.periode-carte {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--espace-3);
  min-height: 4.5rem;
  padding: var(--espace-3) var(--espace-5);
  background: var(--surface);
  color: var(--encre);
  border-radius: var(--rayon);
  box-shadow: inset 0 0 0 2px var(--accent);
  text-align: left;
}
button.periode-carte:hover {
  background: var(--accent-pale);
  color: var(--encre);
}
.periode-nom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
  align-items: center;
  font-weight: 600;
}
.periode-prix {
  font-size: var(--t-grand);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.periode-prix small {
  font-size: var(--t-petit);
  font-weight: 500;
  color: var(--encre-douce);
}

/* Le slogan, sous la marque des pages publiques (à partir de la tablette). */
.marque .slogan {
  display: none;
}
@media (min-width: 48rem) {
  .entete .marque {
    flex-wrap: wrap;
    column-gap: 0.45rem;
    line-height: 1.1;
  }
  .entete .marque .slogan {
    display: block;
    flex-basis: 100%;
    padding-left: 1.55rem;
    font-family: var(--texte);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--encre-douce);
  }
}
@media (max-width: 30rem) {
  .large-seulement {
    display: none;
  }
}
/* Dans une carte, les gestes repliés respirent. */
.feuille details {
  margin-top: var(--espace-2);
}
.feuille details > :not(summary) + * {
  margin-top: var(--espace-3);
}
.feuille details[open] {
  padding-bottom: var(--espace-3);
}

/* Pages de compte d'allauth (templates/allauth/elements) : champs, cases et
   boutons comme dans le reste de l'application ; les boutons s'empilent. */
.formulaire-compte .champ,
.formulaire-compte .champ-case {
  margin-bottom: var(--espace-4);
}
.formulaire-compte .champ input {
  width: 100%;
}
.formulaire-compte .helptext a {
  font-weight: 600;
}
.actions-compte {
  display: flex;
  flex-direction: column;
  gap: var(--espace-2);
  margin-top: var(--espace-4);
}
.actions-compte .lien {
  align-self: center;
}
.panneau-compte h2 {
  margin-top: 0;
}
.sous-formulaire {
  margin-top: var(--espace-5);
  text-align: center;
}
.formulaire-compte .groupe .case {
  display: flex;
  gap: var(--espace-3);
  align-items: center;
  margin: 0;
}
.etiquette.attention {
  background: var(--attention-pale);
  color: var(--attention);
}
.qr-totp {
  text-align: center;
}
.qr-totp img {
  background: #fff;
  padding: var(--espace-3);
  border-radius: 12px;
}
.cle-totp {
  word-break: break-all;
  font-size: var(--t-base);
}
.etapes-totp {
  padding-left: var(--espace-5);
}

/* --- Application installée (écran d'accueil) -------------------------------- */

.installee [data-hors-appli] {
  display: none;
}
.icone-texte {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  color: var(--accent);
}
.installer-une {
  display: flex;
  gap: var(--espace-4);
  align-items: center;
  margin: 0 0 var(--espace-5);
}
.installer-une img {
  flex: none;
  border-radius: 22%;
}
.installer-une p {
  margin: 0;
}
.installer-fait {
  padding: var(--espace-3) var(--espace-4);
  border-radius: 12px;
  background: var(--vert-pale);
  color: var(--vert);
  font-weight: 600;
}
.installer-direct .bouton {
  width: 100%;
}
.etape-numero {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-pale);
  color: var(--accent-fonce);
  font-size: var(--t-petit);
  font-weight: 700;
}
.votre-appareil {
  margin-left: var(--espace-2);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--sur-accent);
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: 0.1em;
}
.hors-ligne {
  text-align: center;
  padding-top: 18vh;
}
.hors-ligne-icone {
  border-radius: 22%;
  margin-bottom: var(--espace-4);
}

/* --- Aide ------------------------------------------------------------------- */

.faq details {
  padding: 0 var(--espace-4);
}
.faq summary {
  justify-content: space-between;
  gap: var(--espace-3);
  padding: 0.65rem 0;
  color: var(--encre);
  font-weight: 600;
}
.faq summary::after {
  flex: none;
  color: var(--encre-douce);
}
.faq details p {
  margin: 0 0 var(--espace-4);
  color: var(--encre-douce);
}
.formulaire-aide textarea {
  width: 100%;
  resize: vertical;
}
/* Le piège à robots : hors de l'écran, hors de la tabulation, hors des lecteurs d'écran. */
.piege {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Segments à boutons radio (le type d'un livre dans sa fiche). */
.choix-type {
  margin: 0 0 var(--espace-4);
  padding: 0;
  border: 0;
}
.segments-radio > label {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 var(--espace-3);
  border-radius: 7px;
  color: var(--encre);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.segments-radio input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.segments-radio > label:has(input:checked) {
  background: var(--accent);
  color: var(--sur-accent);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18);
}
.segments-radio > label:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Maisons ----------------------------------------------------------------- */

.choix-maison {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  margin: 0 0 var(--espace-4);
}
.choix-maison label {
  color: var(--encre-douce);
  font-size: var(--t-petit);
  white-space: nowrap;
}
.choix-maison select {
  width: auto;
  font-weight: 600;
}
.groupe .reserve-illimite {
  color: var(--orange);
  font-size: var(--t-petit);
  font-weight: 600;
}
.offre-maisons {
  border-left: 4px solid var(--orange);
}

/* L'invitation à installer, sous le scanner. */
.invitation-installer {
  display: flex;
  gap: var(--espace-3);
  align-items: flex-start;
}
.invitation-installer img {
  flex: none;
  border-radius: 22%;
}
.invitation-installer h2 {
  margin: 0 0 var(--espace-1);
  font-size: var(--t-base);
}
.invitation-installer p {
  margin: 0 0 var(--espace-2);
}
.invitation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2) var(--espace-4);
  align-items: center;
}

.formule-a-reserver h3 {
  margin: 0 0 var(--espace-1);
}
.formule-a-reserver .choix-periode {
  margin-top: var(--espace-3);
}

/* Version du service, en pied de « Moi » : lisible si on la cherche, invisible sinon. */
.groupe-note.version {
  font-variant-numeric: tabular-nums;
  color: var(--encre-douce);
  opacity: 0.7;
}
