/* Socle structurel, commun a toutes les marques.

   Trois feuilles se suivent dans chaque page :
     1. celle-ci : la mise en page et les composants, sans aucune couleur en dur ;
     2. la feuille du theme de la marque : sa typographie, ses formes ;
     3. /apparence.css : les couleurs — celles de la vitrine, ou celles que le
        compte a choisies.
   Les valeurs ci-dessous ne servent que de repli si la troisieme manquait. */

:root {
  color-scheme: light dark;

  --fond: #f7f7f8;
  --fond-carte: #ffffff;
  --encre: #1b1d21;
  --encre-douce: #5d6169;
  --accent: #2f5d8a;
  --accent-encre: #ffffff;
  --trait: #e2e4e8;
  --danger: #b4341f;
  --succes: #1f7a45;

  --police-titre: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-texte: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --graisse-titre: 650;
  --casse-titre: none;
  --interlettre-titre: normal;

  --rayon: 10px;
  --largeur: 68rem;
  --cible: 2.75rem;               /* 44 px : la plus petite cible tactile, partout */
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15171b;
    --fond-carte: #1d2026;
    --encre: #eceef2;
    --encre-douce: #a4abb6;
    --accent: #7fb0e0;
    --accent-encre: #10151b;
    --trait: #2c3037;
    --danger: #ff8f7d;
    --succes: #74d39a;
  }
}

/* Teintes deduites des couleurs de base. Declarees aussi sur l'apercu de
   l'editeur de theme : la, les couleurs de base changent, elles doivent suivre. */
:root, .apercu-editeur {
  --accent-doux: color-mix(in srgb, var(--accent) 13%, var(--fond-carte));
  --accent-fort: color-mix(in srgb, var(--accent) 86%, var(--encre));
  --survol: color-mix(in srgb, var(--encre) 6%, transparent);
  --danger-doux: color-mix(in srgb, var(--danger) 11%, var(--fond-carte));
  --succes-doux: color-mix(in srgb, var(--succes) 13%, var(--fond-carte));
  --rayon-petit: calc(var(--rayon) * .6);
  --ombre: 0 1px 2px color-mix(in srgb, var(--encre) 7%, transparent),
           0 10px 28px -12px color-mix(in srgb, var(--encre) 22%, transparent);
  --ombre-forte: 0 2px 4px color-mix(in srgb, var(--encre) 8%, transparent),
                 0 22px 48px -18px color-mix(in srgb, var(--encre) 34%, transparent);
}

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

/* Ecritures qui ne se composent pas comme l'alphabet latin : pas d'espacement
   force entre les signes, et un interligne qui laisse respirer la devanagari. */
:lang(zh), :lang(ja), :lang(hi) { --interlettre-titre: normal; }
:lang(zh), :lang(ja) { line-break: strict; }
:lang(hi) body, body:lang(hi) { line-height: 1.8; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--police-texte);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--encre);
  background: var(--fond);
}

h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  text-transform: var(--casse-titre);
  letter-spacing: var(--interlettre-titre);
  line-height: 1.15;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.7rem); }
h2 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-fort); }

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

.evitement {
  position: absolute;
  left: -200vw;
  top: .5rem;
  z-index: 20;
  padding: .5rem 1rem;
  background: var(--fond-carte);
  border-radius: var(--rayon);
}
.evitement:focus { left: .5rem; }

/* --- Icones et logo ------------------------------------------------------ */

.icone {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  vertical-align: -.22em;
}

.logo { width: 2rem; height: 2rem; flex: none; }
.logo-fond { fill: var(--accent); }
.logo-trait {
  fill: none;
  stroke: var(--accent-encre);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Bandeau ------------------------------------------------------------- */

.bandeau {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--fond-carte) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--trait);
}

.bandeau-contenu {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.bandeau .marque {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  text-transform: var(--casse-titre);
  letter-spacing: var(--interlettre-titre);
  font-size: 1.15rem;
  color: var(--encre);
  text-decoration: none;
}

.bandeau nav { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.bandeau nav form { margin: 0; }

.lien-nav {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .7rem;
  border-radius: var(--rayon);
  font-size: .95rem;
  color: var(--encre-douce);
  text-decoration: none;
}
.lien-nav:hover, .lien-nav[aria-current="page"] { color: var(--encre); background: var(--survol); }

/* --- Page ---------------------------------------------------------------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
}

/* Les pages a un seul formulaire se lisent mieux centrees que collees a gauche. */
main.page-centree { max-width: 34rem; }
main.page-centree.page-large { max-width: 54rem; }
main.page-centree .formulaire { max-width: none; }

.entete-page { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.75rem; }
.entete-page > .avatar + div { align-self: center; }
.entete-page h1 { margin: 0; }
.entete-page .chapeau { margin: .25rem 0 0; }

.pastille {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: calc(var(--rayon) + 2px);
  color: var(--accent);
  background: var(--accent-doux);
}
.pastille .icone { width: 1.5rem; height: 1.5rem; }

.avatar {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  flex: none;
  border-radius: 50%;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: .02em;
  color: var(--accent-encre);
  background: linear-gradient(135deg, var(--accent), var(--accent-fort));
}

.avatar--photo { background: var(--trait); overflow: hidden; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar--petit { width: 1.6rem; height: 1.6rem; font-size: .7rem; animation: none; }

.chapeau { color: var(--encre-douce); max-width: 68ch; font-size: 1.05rem; }
.surtitre {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .9rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-doux);
}

.section { margin-top: clamp(2rem, 5vw, 3.5rem); }
.section > h2 { margin-bottom: 1rem; }

/* --- Accueil ------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border: 1px solid var(--trait);
  border-radius: calc(var(--rayon) * 1.6);
  background:
    radial-gradient(60rem 22rem at 105% -20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(40rem 18rem at -10% 120%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--fond-carte);
  box-shadow: var(--ombre);
}
.hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.6rem); max-width: 16ch; }
.hero .chapeau { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); max-width: 52ch; }
.hero .actions { margin: 1.5rem 0 0; }

/* --- Cartes -------------------------------------------------------------- */

.cartes, .grille {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}
.grille--large { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grille--deux { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }

.carte, .panneau {
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.25rem 1.35rem;
}

.carte h3, .panneau h2 { display: flex; align-items: center; gap: .55rem; }
.carte h3 { margin-bottom: .35em; }
.carte p:last-child, .panneau > :last-child { margin-bottom: 0; }
.carte .version { color: var(--encre-douce); font-size: .85rem; }
.carte .pastille { margin-bottom: .9rem; }

.panneau h2 { font-size: 1.1rem; margin-bottom: .9rem; }
.panneau h2 .icone { color: var(--accent); }

.vide {
  grid-column: 1 / -1;
  display: flex;
  gap: .8rem;
  align-items: center;
  border: 1px dashed var(--trait);
  border-radius: var(--rayon);
  padding: 1.25rem;
  color: var(--encre-douce);
}

.etiquette {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .12rem .6rem;
  border-radius: 999px;
  background: var(--accent-doux);
  color: var(--accent);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.etiquette--succes { background: var(--succes-doux); color: var(--succes); }
.etiquette--danger { background: var(--danger-doux); color: var(--danger); }

.fiche { margin: 0; display: grid; gap: .55rem; }
.fiche div { display: flex; flex-wrap: wrap; gap: .25rem .75rem; justify-content: space-between; }
.fiche dt { color: var(--encre-douce); }
.fiche dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.liste-actions { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .25rem; }
.liste-actions a {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 -.6rem;
  padding: .5rem .6rem;
  border-radius: var(--rayon-petit);
  color: var(--encre);
  text-decoration: none;
}
.liste-actions a:hover { background: var(--survol); }
.liste-actions a .icone:first-child { color: var(--accent); }
.liste-actions a .icone:last-child { margin-left: auto; color: var(--encre-douce); width: 1em; height: 1em; }

.sous-titre {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1.2rem 0 .6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--trait);
  font-size: 1rem;
}
.sous-titre .icone { color: var(--accent); }

.envoi-photo { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .5rem; }
.envoi-photo input[type="file"] { flex: 1 1 12rem; min-width: 0; font: inherit; font-size: .9rem; color: var(--encre-douce); }
.envoi-photo input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 600;
  margin-right: .7rem;
  padding: .35rem .7rem;
  color: var(--encre);
  background: transparent;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  cursor: pointer;
}
.envoi-photo input[type="file"]::file-selector-button:hover { background: var(--survol); border-color: var(--encre-douce); }
.panneau form + form, .panneau .aide + form { margin-top: .6rem; }

/* Cadrage de la photo : l'image glisse sous une fenetre ronde. */
.recadrage { display: grid; gap: .6rem; justify-items: start; margin: .8rem 0; }
.recadrage[hidden] { display: none; }
.recadrage-zone {
  position: relative;
  width: min(16rem, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--rayon);
  background: var(--trait);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.recadrage-zone:active { cursor: grabbing; }
.recadrage-zone img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
/* Ce qui deborde du cercle est voile : c'est ce qui ne sera pas garde. */
.recadrage-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--fond-carte) 72%, transparent);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  pointer-events: none;
}
.recadrage-zoom { display: flex; align-items: center; gap: .5rem; width: min(16rem, 100%); font-size: .9rem; color: var(--encre-douce); }
.recadrage-zoom input { flex: 1; accent-color: var(--accent); }

.liste-plate { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .4rem; }
.liste-plate .vide { border: 0; padding: 0; }

/* --- Pied ---------------------------------------------------------------- */

.pied {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  color: var(--encre-douce);
  font-size: .9rem;
  border-top: 1px solid var(--trait);
}
.pied p { margin: 0; }
.pied-liens { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
/* Choix de la langue, dans le bandeau : un menu qui s'ouvre sous son bouton. */
.langues { position: relative; }
.langues summary { cursor: pointer; list-style: none; }
.langues summary::-webkit-details-marker { display: none; }
.langues[open] summary { color: var(--encre); background: var(--survol); }
.langues-liste {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
  gap: .2rem;
  padding: .5rem;
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-forte);
}
.langues-liste button {
  justify-content: flex-start;
  padding: .45rem .7rem;
  font-weight: 500;
  font-size: .95rem;
  color: var(--encre);
  background: transparent;
  border-radius: var(--rayon-petit);
}
.langues-liste button:hover { background: var(--survol); color: var(--encre); }
.langues-liste button[aria-current="true"] { color: var(--accent); background: var(--accent-doux); font-weight: 650; }
@media (max-width: 30rem) { .langues-liste { right: auto; left: 0; grid-template-columns: 1fr 1fr; } }

/* Proposition d'une langue que le navigateur n'annonce pas. */
.suggestion-langue { background: var(--accent-doux); border-bottom: 1px solid var(--trait); }
.suggestion-langue form {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: .45rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: flex-end;
}
.pied a { color: var(--encre-douce); }
.pied a:hover { color: var(--accent); }

/* Pages de texte long : conditions generales, confidentialite. */
main.page-texte { max-width: 46rem; }
.page-texte h2 { margin-top: 2.2rem; }
.page-texte h2:first-of-type { margin-top: 1.5rem; }
.page-texte li { margin-bottom: .35rem; }
.page-texte .sommaire { columns: 2 16rem; padding-left: 1.2rem; color: var(--encre-douce); font-size: .92rem; }
.a-completer { border: 1px dashed var(--danger); border-radius: var(--rayon); padding: .1rem .4rem; color: var(--danger); }

/* --- Messages et alertes ------------------------------------------------- */

.messages {
  list-style: none;
  width: 100%;
  max-width: var(--largeur);
  margin: 1rem auto 0;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: grid;
  gap: .5rem;
}

.message, .alerte {
  padding: .75rem 1rem;
  border-radius: var(--rayon);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--accent);
  background: var(--fond-carte);
}
.message.success { border-left-color: var(--succes); background: var(--succes-doux); }
.message.warning, .message.error, .alerte {
  border-left-color: var(--danger);
  background: var(--danger-doux);
}

.alerte { margin: 1rem 0; padding: .9rem 1.1rem; }
.alerte p:first-child { margin-top: 0; }
.alerte p:last-child { margin-bottom: 0; }
.alerte form { margin: .6rem 0 0; }

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

button, .bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent-encre);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--rayon);
  padding: .65rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .05s;
}
button:hover, .bouton:hover { background: var(--accent-fort); color: var(--accent-encre); }
button:active, .bouton:active { transform: translateY(1px); }

.bouton-discret, .bouton-discret:hover {
  color: var(--encre);
  background: transparent;
  border-color: var(--trait);
}
.bouton-discret:hover { background: var(--survol); border-color: var(--encre-douce); }
.bouton-danger, .bouton-danger:hover { color: var(--danger); background: transparent; border-color: var(--trait); }
.bouton-danger:hover { background: var(--danger-doux); border-color: var(--danger); }
.bouton-petit { padding: .35rem .7rem; font-size: .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; }
.actions[hidden] { display: none; }

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

.formulaire {
  max-width: 28rem;
  margin: 1.5rem 0;
  display: grid;
  gap: .25rem;
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: calc(var(--rayon) * 1.3);
  box-shadow: var(--ombre);
  padding: clamp(1.1rem, 3vw, 1.9rem);
}
.formulaire > p:last-child { margin-bottom: 0; }
.formulaire > .actions:last-child { margin-bottom: 0; }

.champ { display: grid; gap: .3rem; margin: 0 0 1rem; align-content: start; }
.champ label { font-weight: 600; font-size: .95rem; }

.champ input, .champ select, .champ textarea {
  font: inherit;
  color: var(--encre);
  background: var(--fond);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: .6rem .75rem;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.champ input:hover, .champ select:hover, .champ textarea:hover { border-color: var(--encre-douce); }
.champ input:focus-visible, .champ select:focus-visible, .champ textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
.champ input[type="color"] { height: 2.9rem; padding: .25rem; cursor: pointer; }
.champ input[type="range"] { padding: 0; height: 2.9rem; border: 0; background: transparent; accent-color: var(--accent); }
.champ input[type="range"]:focus-visible { box-shadow: none; outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ecran large : un long formulaire s'etale sur deux colonnes au lieu de
   s'empiler comme sur un telephone. Tout prend la largeur entiere, sauf les
   champs que le formulaire declare en demi-largeur. */
@media (min-width: 48rem) {
  .formulaire--large {
    max-width: 48rem;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }
  .formulaire--large > * { grid-column: 1 / -1; }
  .formulaire--large > .champ--demi { grid-column: auto; }
}

.champ--case label { display: flex; align-items: center; gap: .6rem; font-weight: 600; cursor: pointer; }
.champ--case input[type="checkbox"] { width: 1.15rem; height: 1.15rem; flex: none; padding: 0; accent-color: var(--accent); }

/* Champ piege de l'anti-robot : hors de l'ecran, hors de la tabulation. */
.piege { position: absolute; left: -200vw; width: 1px; height: 1px; overflow: hidden; }
.antirobot { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: .88rem; color: var(--encre-douce); }
.antirobot--fait { color: var(--succes); }
button:disabled { opacity: .55; cursor: progress; }

.appareils { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .5rem; }
.appareils li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; justify-content: space-between; }
.appareils form { margin: 0; }
.appareil-nom { display: grid; justify-items: start; }

.champ textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.aide { color: var(--encre-douce); font-size: .85rem; }
.aide ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.erreur { color: var(--danger); font-size: .9rem; font-weight: 600; }

button + a, .bouton + a:not(.bouton) { margin-left: .4rem; }

/* --- Second facteur ------------------------------------------------------ */

.encart {
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond-carte);
  padding: 1.1rem;
  margin: 1.5rem 0;
}

.qr {
  display: block;
  width: 220px;
  height: 220px;
  background: #ffffff;        /* le code doit rester lisible quel que soit le theme */
  border-radius: 6px;
  padding: 8px;
}

.encart code, .codes code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
}

.codes {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}

.codes li {
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: .6rem .7rem;
  text-align: center;
  font-size: 1.05rem;
}

.seulement-impression { display: none; }

/* --- Apparence ----------------------------------------------------------- */

.segments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--trait);
  border-radius: calc(var(--rayon) + .25rem);
  background: var(--fond-carte);
}
.segments button {
  color: var(--encre-douce);
  background: transparent;
  padding: .45rem .9rem;
  font-size: .95rem;
}
.segments button:hover { color: var(--encre); background: var(--survol); }
.segments button[aria-pressed="true"] { color: var(--accent-encre); background: var(--accent); }

.themes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr));
}
.themes form { margin: 0; }

.theme-carte {
  position: relative;
  display: grid;
  /* Une colonne de largeur definie : sans elle l'apercu, dont la hauteur depend
     de la largeur, se replie sur son contenu. */
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: .6rem;
  width: 100%;
  padding: .6rem;
  text-align: left;
  font-weight: 400;
  color: var(--encre);
  background: var(--fond-carte);
  border: 1px solid var(--trait);
  border-radius: calc(var(--rayon) * 1.2);
  box-shadow: var(--ombre);
}
.theme-carte:hover { color: var(--encre); background: var(--fond-carte); border-color: var(--accent); }
.theme-carte[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), var(--ombre);
}
.theme-carte .coche {
  position: absolute;
  top: .95rem;
  right: .95rem;
  display: none;
  color: var(--a-accent, var(--accent));
}
.theme-carte[aria-pressed="true"] .coche { display: block; }
.theme-nom { font-weight: 650; padding: 0 .25rem; }
.theme-detail { display: block; font-weight: 400; font-size: .85rem; color: var(--encre-douce); }

.theme-outils { display: flex; gap: .4rem; margin-top: .5rem; }
.theme-outils > * { flex: 1; }

/* Le dessin d'un theme en miniature. Ses couleurs sont posees par le script
   d'apres les attributs data-* ; sans script, il prend celles de la page. */
.apercu {
  width: 100%;
  display: grid;
  gap: .4rem;
  padding: .7rem;
  aspect-ratio: 16 / 10;
  align-content: start;
  border-radius: var(--rayon);
  border: 1px solid var(--a-trait, var(--trait));
  background: var(--a-fond, var(--fond));
}
.apercu-barre { height: .55rem; width: 45%; border-radius: 99px; background: var(--a-encre, var(--encre)); }
.apercu-bloc {
  display: grid;
  gap: .35rem;
  padding: .5rem;
  border-radius: calc(var(--rayon) * .7);
  border: 1px solid var(--a-trait, var(--trait));
  background: var(--a-carte, var(--fond-carte));
}
.apercu-ligne { height: .35rem; border-radius: 99px; background: var(--a-encre, var(--encre)); opacity: .32; }
.apercu-ligne.courte { width: 60%; }
.apercu-bouton { height: .8rem; width: 40%; border-radius: 99px; background: var(--a-accent, var(--accent)); }

.editeur { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 60rem) { .editeur { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } }
.editeur .formulaire { margin: 0; max-width: none; }

.apercu-editeur {
  position: sticky;
  top: 5rem;
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: calc(var(--rayon) * 1.3);
  border: 1px solid var(--trait);
  color: var(--encre);
  background: var(--fond);
  font-family: var(--police-texte);
  box-shadow: var(--ombre-forte);
}
.apercu-editeur .surtitre { justify-self: start; margin: 0; }
.apercu-editeur h3 { font-family: var(--police-titre); font-size: 1.3rem; margin: 0; }
.apercu-editeur p { margin: 0; color: var(--encre-douce); }
.apercu-editeur .panneau { box-shadow: none; display: grid; gap: .8rem; }
.apercu-editeur .faux-champ {
  padding: .55rem .75rem;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond);
  color: var(--encre-douce);
}
.valeur { font-variant-numeric: tabular-nums; color: var(--encre-douce); font-weight: 400; }

/* --- Mouvement ----------------------------------------------------------- */
/* Tout ce qui bouge est decoratif : l'etat de repos est toujours l'etat final,
   et l'etat de depart n'existe que dans les images-cles. Sans animation
   (reglage « reduire les animations », impression), la page est donc complete. */

/* Fondu entre deux pages du site, la ou le navigateur le permet. */
@view-transition { navigation: auto; }

@keyframes apparait { from { opacity: 0; transform: translateY(12px); } }
@keyframes glisse { from { opacity: 0; transform: translateY(-10px); } }
@keyframes trace { from { stroke-dashoffset: 1; } }
@keyframes pose { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
@keyframes salue { 30% { transform: rotate(-9deg) scale(1.06); } 65% { transform: rotate(6deg) scale(1.06); } }
@keyframes derive { to { transform: translate(-3rem, 2rem) scale(1.15); } }
@keyframes eclot { from { opacity: 0; transform: scale(.3); } 60% { transform: scale(1.25); } }
@keyframes halo { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
                  to { box-shadow: 0 0 0 1rem transparent; } }
@keyframes ombre-bandeau { to { box-shadow: var(--ombre); } }

main > * { animation: apparait .55s cubic-bezier(.2, .7, .2, 1) both; }
main > :nth-child(2) { animation-delay: .06s; }
main > :nth-child(3) { animation-delay: .12s; }
main > :nth-child(4) { animation-delay: .18s; }
main > :nth-child(n+5) { animation-delay: .24s; }

.cartes > *, .grille > *, .themes > * { animation: apparait .5s cubic-bezier(.2, .7, .2, 1) both; }
.cartes > :nth-child(2), .grille > :nth-child(2), .themes > :nth-child(2) { animation-delay: .25s; }
.cartes > :nth-child(3), .grille > :nth-child(3), .themes > :nth-child(3) { animation-delay: .31s; }
.cartes > :nth-child(4), .grille > :nth-child(4), .themes > :nth-child(4) { animation-delay: .37s; }
.cartes > :nth-child(n+5), .grille > :nth-child(n+5), .themes > :nth-child(n+5) { animation-delay: .43s; }
.cartes > :first-child, .grille > :first-child, .themes > :first-child { animation-delay: .19s; }

.message { animation: glisse .4s cubic-bezier(.2, .7, .2, 1) both; }

/* Le logo se dessine a l'arrivee, et salue au survol. */
.logo { transform-origin: center; }
.logo-fond { transform-origin: center; transform-box: fill-box; animation: pose .5s cubic-bezier(.2, .8, .2, 1.2) both; }
.logo-trait { stroke-dasharray: 1; animation: trace .9s .25s ease-out both; }
.marque:hover .logo { animation: salue .6s ease-in-out; }

/* Logo en corolle (Katharina) : les petales eclosent l'un apres l'autre. */
.logo-petale { fill: var(--accent); transform-box: view-box; transform-origin: 16px 16px; animation: eclot .6s cubic-bezier(.2, .8, .2, 1.2) both; }
.logo-petale--clair { fill: color-mix(in srgb, var(--accent) 58%, var(--fond-carte)); }
.logo-corolle g:nth-child(2) .logo-petale { animation-delay: .07s; }
.logo-corolle g:nth-child(3) .logo-petale { animation-delay: .14s; }
.logo-corolle g:nth-child(4) .logo-petale { animation-delay: .21s; }
.logo-corolle g:nth-child(5) .logo-petale { animation-delay: .28s; }
.logo-corolle g:nth-child(6) .logo-petale { animation-delay: .35s; }
.logo-coeur { fill: var(--fond-carte); }
.logo-corolle { transform-origin: 16px 16px; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.marque:hover .logo--corolle { animation: none; }
.marque:hover .logo-corolle { transform: rotate(120deg); }

/* Logo en couches (Maximilian). Arrivee : le plan du haut se dessine au trait
   puis se remplit, les deux autres se tracent a la suite. Survol : la pile respire.
   Remplissage « backwards » seulement : une fois l'arrivee jouee, l'animation
   lache la propriete et la transition du survol peut agir. */
@keyframes couche-trace { from { stroke-dashoffset: 1; } }
@keyframes couche-remplit { from { opacity: 0; } }
.logo-couche { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.logo-couche-plein { fill: color-mix(in srgb, var(--accent) 58%, var(--fond-carte));
                     animation: couche-remplit .45s .6s ease backwards; }
.logo-couche-contour { fill: none; stroke: color-mix(in srgb, var(--accent) 58%, var(--fond-carte));
                       stroke-width: 1.600; stroke-linejoin: round; stroke-dasharray: 1;
                       animation: couche-trace .7s .1s ease-out backwards; }
.logo-couche--milieu, .logo-couche--bas { fill: none; stroke: var(--accent); stroke-width: 2.400;
                                          stroke-linecap: round; stroke-linejoin: round;
                                          stroke-dasharray: 1; }
.logo-couche--milieu { animation: couche-trace .5s .6s ease-out backwards; }
.logo-couche--bas { animation: couche-trace .5s .85s ease-out backwards; }
.marque:hover .logo--couches { animation: none; }
.marque:hover .logo-couche--haut { transform: translateY(-2.500px); }
.marque:hover .logo-couche--bas { transform: translateY(2.500px); }

/* Cartes et panneaux se soulevent sous le pointeur. */
.carte, .panneau, .theme-carte, .pastille, .icone { transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s, border-color .22s; }
.carte:hover, .panneau:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); }
.theme-carte:hover { transform: translateY(-3px); }
.carte:hover .pastille { transform: rotate(-7deg) scale(1.08); }
.theme-carte[aria-pressed="true"] .coche { animation: eclot .45s cubic-bezier(.2, .8, .2, 1.3) both; }

/* Les fleches avancent d'un pas. */
.bouton:hover .icone:last-child, button:hover .icone:last-child,
.liste-actions a:hover .icone:last-child { transform: translateX(3px); }
.lien-nav:hover .icone { transform: scale(1.12); }

.avatar { animation: halo 1.6s .5s ease-out 1; }
.etiquette--succes .icone { animation: eclot .5s .4s cubic-bezier(.2, .8, .2, 1.3) both; }

/* Deux halos derivent lentement derriere le texte d'accueil. */
.hero > * { position: relative; }
.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%);
  animation: derive 13s ease-in-out infinite alternate;
}
.hero::before { top: -11rem; right: -6rem; }
.hero::after { bottom: -14rem; left: -8rem; animation-duration: 17s; animation-direction: alternate-reverse; }

/* Le bandeau prend de l'ombre des que la page defile. */
@supports (animation-timeline: scroll()) {
  .bandeau { animation: ombre-bandeau linear both; animation-timeline: scroll(); animation-range: 0 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* --- Impression ---------------------------------------------------------- */

/* Une page imprimee ne garde que son contenu : ni navigation, ni boutons. */
@media print {
  body { background: #ffffff; color: #000000; }
  .bandeau { position: static; }
  .bandeau nav, .pied, .messages, .actions, .sans-impression { display: none; }
  .seulement-impression { display: block; }
  .alerte, .codes li { background: #ffffff; border-color: #000000; }
}

/* --- groupes ---------------------------------------------------------------- */
.membre { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.membre .avatar { flex: none; }
.lien-invitation { margin: .7rem 0 0; }
.lien-invitation code {
  display: block; padding: .6rem .8rem; background: var(--fond); border: 1px solid var(--trait);
  border-radius: var(--rayon); overflow-wrap: anywhere; user-select: all; font-size: .9rem;
}
.actions-ligne { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions-ligne form { display: flex; gap: .4rem; align-items: center; }
.actions-ligne select {
  font: inherit; color: inherit; background: var(--fond); border: 1px solid var(--trait);
  border-radius: var(--rayon); padding: .3rem .5rem;
}
.alerte--succes { border-color: var(--succes); background: var(--succes-doux); }
.page-large > .panneau + .panneau { margin-top: 1.25rem; }

/* --- partenaires, offres ---------------------------------------------------- */
.partenaires { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 0; }
.partenaires--pied { margin: .8rem 0 0; justify-content: center; }
.partenaire {
  display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; text-decoration: none; color: inherit;
  background: var(--fond-carte); border: 1px solid var(--trait); border-radius: var(--rayon);
  transition: border-color .2s, transform .2s;
}
.partenaire:hover { border-color: var(--accent); transform: translateY(-1px); }
.partenaire img { max-height: 2.6rem; max-width: 9rem; width: auto; height: auto; }
.partenaire-texte { display: grid; }
.partenaire-texte span { color: var(--encre-douce); font-size: .9rem; }
.partenaires--pied .partenaire { padding: .4rem .7rem; font-size: .9rem; }
.partenaires--pied .partenaire img { max-height: 1.6rem; }
.prix { font-size: 1.05rem; margin: .2rem 0 .6rem; }

/* --- genealogie -------------------------------------------------------------- */
.liste-personnes { list-style: none; margin: 0; padding: 0; columns: 2 18rem; column-gap: 2rem; }
.liste-personnes li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0;
  border-bottom: 1px solid var(--trait); break-inside: avoid; }
.personne-nom { min-width: 0; overflow-wrap: anywhere; }

/* Visuels de rubrique : vignette sur la carte d'un module, bandeau en tete de sa page. */
.visuel { display: block; width: 100%; height: auto; border-radius: var(--rayon, .75rem); }
.visuel--vignette { aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: .75rem; }
.visuel--bandeau { aspect-ratio: 3 / 1; object-fit: cover; margin-bottom: 1.25rem; }

/* --- Menu replie (tablette et telephone) --------------------------------- */

.menu-case { position: absolute; opacity: 0; pointer-events: none; }
.menu-bouton { display: none; }
.visuel--icone { display: none; }
.carte-visuel { display: block; }

@media (max-width: 62rem) {
  .menu-bouton {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: .28rem;
    margin-left: auto;
    padding: .65rem .6rem;
    border-radius: var(--rayon);
    cursor: pointer;
  }
  .menu-bouton:hover { background: var(--survol); }
  .menu-barre { display: block; width: 1.4rem; height: .17rem; border-radius: .1rem; background: var(--encre); }
  .menu-case:focus-visible + .menu-bouton { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
  .bandeau nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: .15rem; }
  .menu-case:checked ~ nav { display: flex; }
  .menu-case:checked + .menu-bouton .menu-barre:nth-child(1) { transform: translateY(.45rem) rotate(45deg); }
  .menu-case:checked + .menu-bouton .menu-barre:nth-child(2) { opacity: 0; }
  .menu-case:checked + .menu-bouton .menu-barre:nth-child(3) { transform: translateY(-.45rem) rotate(-45deg); }

  /* Accueil d'un compte connecte : les modules d'abord, en icones. */
  .hero--compte { display: none; }
  .section--vitrine { display: none; }
  .cartes--modules { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); }
  .cartes--modules .carte { padding: .6rem; text-align: center; }
  .cartes--modules .visuel--vignette, .cartes--modules .carte-description,
  .cartes--modules .carte-visuel ~ .pastille { display: none; }
  .cartes--modules .visuel--icone { display: block; aspect-ratio: 1; object-fit: cover; margin-bottom: .5rem; }
  .cartes--modules .carte h3 { justify-content: center; margin: 0; font-size: 1rem; }
}

/* Accueil d'un compte connecte : un bandeau de bienvenue discret, les modules comptent davantage. */
.hero.hero--compte { padding: 1rem 1.5rem 1.15rem; }
.hero.hero--compte .surtitre { margin-bottom: .45rem; font-size: .8rem; }
.hero.hero--compte h1 { font-size: clamp(1.45rem, 1.1rem + 1vw, 1.9rem); max-width: none; margin-bottom: .2em; }
.hero.hero--compte .chapeau { font-size: 1rem; margin-bottom: 0; }
.hero.hero--compte .actions { margin-top: .85rem; }
.hero.hero--compte::before, .hero.hero--compte::after { width: 14rem; height: 14rem; }

/* Application Android : bloc a droite du bandeau d'accueil (PC), et page de presentation. */
.hero--compte { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2rem; align-items: center; }
.hero--compte > :not(.hero-app) { grid-column: 1; }
.hero-app {
  grid-column: 2; grid-row: 1 / span 5;
  display: grid; justify-items: start; gap: .3rem; max-width: 15rem;
  padding: .8rem 1rem;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: color-mix(in srgb, var(--fond-carte) 80%, transparent);
}
.hero-app p { margin: 0; }
.hero-app-pastille .icone { width: 1.4rem; height: 1.4rem; color: var(--accent); }
.hero-app-titre { font-weight: 600; }
.hero-app-texte { color: var(--encre-douce); font-size: .9rem; }
.hero-app .bouton { margin-top: .35rem; }
.application-play { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.application-qr { width: 200px; height: 200px; background: #fff; padding: .5rem; border-radius: var(--rayon); }
.hero--compte > .surtitre, .hero--compte > .actions { justify-self: start; }
.hero-app { max-width: 17rem; }

/* Fiche publique d'un module. */
.fiche-points { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .6rem; }
.fiche-points li { display: flex; gap: .6rem; align-items: flex-start; }
.fiche-points .icone { flex: none; margin-top: .2rem; color: var(--accent); }


/* Panneaux de hauteurs inegales (Mon compte) : colonnes independantes, pas de vide a l'etirement. */
.mosaique { columns: 21rem 2; column-gap: 1rem; }
.mosaique > * { break-inside: avoid; margin: 0 0 1rem; }

/* Partage a la Windows : une ligne par personne ou groupe ayant acces, avec son droit. */
.acces { list-style: none; margin: .25rem 0 1rem; padding: 0; display: grid; gap: .4rem; }
.acces-ligne {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .6rem .85rem; border: 1px solid var(--trait); border-radius: var(--rayon-petit);
  background: var(--fond-carte);
}
.acces-nom { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .5rem; font-weight: 600; overflow-wrap: anywhere; }
.acces-ajout { margin-top: .75rem; display: grid; gap: .75rem; max-width: 30rem; }
.partage-element { margin: 0 0 1rem; }
.partage-element-nom { margin: 0 0 .25rem; }
.partage-titre { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1rem; }

/* --- Rubriques lisibles : titre en relief, pictogramme en pastille de couleur ------------
   La couleur vient du pictogramme lui-meme (une teinte par sens : securite = vert, identite =
   bleu...). Les teintes sont assez moyennes pour se lire en clair comme en sombre ; la
   pastille se teinte a 16 % de la couleur du pictogramme. Seul le contenu des panneaux est
   concerne : la barre de navigation garde sa sobriete. */
.panneau .icone:has(use[href$="#i-bouclier"]), .panneau .icone:has(use[href$="#i-verifie"]),
.panneau .icone:has(use[href$="#i-plus"]) { color: #1f9d55; }
.panneau .icone:has(use[href$="#i-utilisateur"]), .panneau .icone:has(use[href$="#i-courrier"]),
.panneau .icone:has(use[href$="#i-entree"]), .panneau .icone:has(use[href$="#i-langue"]) { color: #3b82f6; }
.panneau .icone:has(use[href$="#i-palette"]), .panneau .icone:has(use[href$="#i-reglages"]),
.panneau .icone:has(use[href$="#i-crayon"]) { color: #8b5cf6; }
.panneau .icone:has(use[href$="#i-groupe"]), .panneau .icone:has(use[href$="#i-arbre"]),
.panneau .icone:has(use[href$="#i-telephone"]) { color: #0e9fb3; }
.panneau .icone:has(use[href$="#i-cube"]), .panneau .icone:has(use[href$="#i-tableau"]),
.panneau .icone:has(use[href$="#i-telecharger"]) { color: #e8821e; }
.panneau .icone:has(use[href$="#i-carte"]), .panneau .icone:has(use[href$="#i-tarot"]),
.panneau .icone:has(use[href$="#i-photo"]), .panneau .icone:has(use[href$="#i-cle"]) { color: #d29a00; }
.panneau .icone:has(use[href$="#i-cadenas"]) { color: #6366f1; }
.panneau .icone:has(use[href$="#i-alerte"]), .panneau .icone:has(use[href$="#i-corbeille"]),
.panneau .icone:has(use[href$="#i-sortie"]) { color: #e5484d; }

.panneau > h2 {
  gap: .75rem;
  margin: 0 0 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--trait);
  font-size: 1.2rem;
}
.panneau > h2 > .icone:first-child {
  box-sizing: content-box;
  width: 1.35rem;
  height: 1.35rem;
  padding: .5rem;
  border-radius: .75rem;
  vertical-align: middle;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.panneau .sous-titre { display: flex; align-items: center; gap: .55rem; font-size: 1.02rem; }
.panneau .sous-titre > .icone:first-child {
  box-sizing: content-box;
  width: 1.05rem;
  height: 1.05rem;
  padding: .35rem;
  border-radius: .55rem;
  background: color-mix(in srgb, currentColor 16%, transparent);
}
.liste-actions a .icone:first-child {
  box-sizing: content-box;
  width: 1.1rem;
  height: 1.1rem;
  padding: .35rem;
  border-radius: .55rem;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

/* --- Rubriques delimitees : bandeau de titre teinte, bords du contenu repris -------------
   Chaque panneau prend la teinte de son pictogramme : le bandeau de titre est plus soutenu,
   et le cadre du panneau (filet, barre de gauche) reprend la meme couleur. Les pictogrammes
   sont des petits logos en couleurs (noyau/icones-couleur.svg), pas des glyphes unis. */
.panneau { --teinte: var(--accent); border-left: 4px solid var(--teinte);
  border-color: color-mix(in srgb, var(--teinte) 38%, var(--trait)); border-left-color: var(--teinte); }
.panneau:has(> h2:first-child) { padding-top: 0; overflow: hidden; }
.panneau:has(> h2 use[href$="#c-bouclier"]), .panneau:has(> h2 use[href$="#c-verifie"]),
.panneau:has(> h2 use[href$="#c-plus"]), .panneau:has(> h2 use[href$="#c-arbre"]) { --teinte: #1f9d55; }
.panneau:has(> h2 use[href$="#c-utilisateur"]), .panneau:has(> h2 use[href$="#c-courrier"]),
.panneau:has(> h2 use[href$="#c-entree"]), .panneau:has(> h2 use[href$="#c-langue"]),
.panneau:has(> h2 use[href$="#c-photo"]) { --teinte: #2f6fe0; }
.panneau:has(> h2 use[href$="#c-palette"]), .panneau:has(> h2 use[href$="#c-reglages"]),
.panneau:has(> h2 use[href$="#c-crayon"]), .panneau:has(> h2 use[href$="#c-tarot"]) { --teinte: #7c4dde; }
.panneau:has(> h2 use[href$="#c-groupe"]), .panneau:has(> h2 use[href$="#c-telephone"]) { --teinte: #0e8fa3; }
.panneau:has(> h2 use[href$="#c-cube"]), .panneau:has(> h2 use[href$="#c-tableau"]),
.panneau:has(> h2 use[href$="#c-telecharger"]) { --teinte: #d9741a; }
.panneau:has(> h2 use[href$="#c-carte"]), .panneau:has(> h2 use[href$="#c-cle"]),
.panneau:has(> h2 use[href$="#c-cadenas"]) { --teinte: #b98400; }
.panneau:has(> h2 use[href$="#c-alerte"]), .panneau:has(> h2 use[href$="#c-corbeille"]),
.panneau:has(> h2 use[href$="#c-sortie"]) { --teinte: #d8383d; }

.panneau > h2 {
  margin: 0 -1.35rem 1.1rem;
  padding: .8rem 1.35rem;
  border: 0;
  border-bottom: 2px solid color-mix(in srgb, var(--teinte) 60%, transparent);
  background: color-mix(in srgb, var(--teinte) 17%, var(--fond-carte));
  font-size: 1.15rem;
}
.icone--couleur { width: 1.9rem; height: 1.9rem; vertical-align: middle; }
.panneau > h2 > .icone--couleur:first-child,
.panneau .sous-titre > .icone--couleur:first-child,
.liste-actions a .icone--couleur:first-child {
  box-sizing: border-box; padding: 0; border-radius: 0; background: none;
}
.panneau .sous-titre > .icone--couleur:first-child { width: 1.5rem; height: 1.5rem; }
.liste-actions a .icone--couleur:first-child { width: 1.6rem; height: 1.6rem; }
.pastille .icone--couleur { width: 1.7rem; height: 1.7rem; }
.panneau > h2 > .icone--couleur:first-child { width: 2rem; height: 2rem; }
.entete-page .pastille .icone--couleur, .carte .pastille .icone--couleur { width: 2rem; height: 2rem; }

/* Les panneaux de partage restent replies tant qu'on ne les ouvre pas : l'en-tete porte un chevron a droite. */
.partage--replie > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  cursor: pointer; list-style: none; }
.partage--replie > summary::-webkit-details-marker { display: none; }
.partage--replie > summary h2 { margin: 0; }
.partage--replie > summary::after { content: ""; flex: none; width: .75rem; height: .75rem; margin: 0 .5rem .3rem 0;
  border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg);
  transition: transform .15s ease; opacity: .75; }
.partage--replie[open] > summary::after { transform: rotate(-135deg); margin: .3rem .5rem 0 0; }
.partage--replie[open] > summary { margin-bottom: .75rem; }

/* --- Composants communs --------------------------------------------------
   Une seule maniere de faire chaque chose, dans toutes les applications :
     - revenir en arriere : la fleche a gauche du titre (`.btn-retour`) ;
     - annuler / valider un formulaire : une croix puis une coche, a droite, en haut et en bas
       de la page (`.barre-validation`, `{% validation %}`) ;
     - les gestes d'une page : des pictogrammes de 44 px a droite du titre (`.barre-actions`) ;
     - jamais plus de trois pictogrammes d'action sur une ligne ;
     - le texte des libelles reste en infobulle et pour les lecteurs d'ecran. */
.barre-page { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.25rem; min-height: var(--cible); }
.barre-page > h1 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem); overflow-wrap: anywhere; }
.barre-actions { display: flex; align-items: center; gap: .45rem; margin-inline-start: auto; flex: none; }
.barre-validation { display: flex; justify-content: flex-end; align-items: center; gap: .5rem; margin: 1rem 0; }
.barre-page .barre-validation { margin: 0; }

.btn-icone {
  display: inline-grid; place-items: center; flex: none;
  width: var(--cible); height: var(--cible); padding: 0;
  color: var(--encre); background: transparent;
  border: 1px solid var(--trait); border-radius: var(--rayon);
  cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn-icone .icone { width: 1.4rem; height: 1.4rem; }
.btn-icone:hover { color: var(--encre); background: var(--survol); border-color: var(--encre-douce); }
.btn-icone:active { transform: scale(.94); }
.btn-icone[aria-pressed="true"] { background: var(--accent-doux); border-color: var(--accent); color: var(--accent-fort); }
.btn-icone[aria-pressed="true"] svg path { fill: currentColor; fill-opacity: .25; }
.btn-retour { border-color: transparent; margin-inline-start: -.5rem; }
.btn-ok, .btn-ok:hover { color: var(--accent-encre); background: var(--accent); border-color: transparent; }
.btn-ok:hover { background: var(--accent-fort); }
.btn-icone.btn-danger { color: var(--danger); }
.btn-icone.btn-danger:hover { color: var(--danger); background: var(--danger-doux); border-color: var(--danger); }
.btn-icone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.btn-icone { position: relative; }
.btn-icone .masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn-groupe { display: inline-flex; gap: .25rem; }

/* Cibles tactiles : jamais en dessous de 44 px sur ecran tactile. */
@media (pointer: coarse) {
  button, .bouton { min-height: var(--cible); }
  .bouton-petit { min-height: 2.5rem; }
  .champ input, .champ select { min-height: var(--cible); }
}

/* Les pages et les messages arrivent en douceur ; rien ne bouge si l'utilisateur l'a demande. */
@keyframes arrivee { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main { animation: arrivee .22s ease-out; }
@media (prefers-reduced-motion: reduce) { main { animation: none; } }

/* --- Plein ecran : le contenu ne passe pas sous l'encoche ni sous la barre de gestes ---------- */
.bandeau { padding-top: env(safe-area-inset-top); }
.bandeau-contenu, main, .pied { padding-left: max(var(--gouttiere, 0px), env(safe-area-inset-left)); padding-right: max(var(--gouttiere, 0px), env(safe-area-inset-right)); }
.pied { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

/* --- Lignes de liste : texte a gauche, actions toujours a droite ------------------------------ */
.appareils li:has(> .btn-groupe, > .menu-ligne) { flex-wrap: nowrap; }
.appareils li > .appareil-nom { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; }
.appareil-nom strong a { text-decoration: none; }
.appareil-nom strong a:hover { text-decoration: underline; }
.btn-groupe { flex: none; align-items: center; }

/* Menu « plus d'actions » d'une ligne : sans script, ferme par un second toucher. */
.menu-ligne { position: relative; flex: none; }
.menu-ligne > summary { list-style: none; }
.menu-ligne > summary::-webkit-details-marker { display: none; }
.menu-ligne-liste { position: absolute; inset-inline-end: 0; top: calc(100% + .3rem); z-index: 6; min-width: 13rem;
  padding: .3rem; background: var(--fond-carte); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); display: grid; }
.menu-item { display: flex; align-items: center; gap: .6rem; min-height: var(--cible); padding: 0 .8rem;
  border-radius: var(--rayon-petit); color: var(--encre); text-decoration: none; }
.menu-item:hover { background: var(--survol); color: var(--encre); }
.menu-item.btn-danger, .menu-item.btn-danger:hover { color: var(--danger); }
.menu-item .icone { width: 1.25rem; height: 1.25rem; }

/* Panneau replie (formulaire de creation) : meme chevron que le partage. */
.panneau--repliable > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; }
.panneau--repliable > summary::-webkit-details-marker { display: none; }
.panneau--repliable > summary h2 { margin: 0; }
.panneau--repliable > summary::after { content: ""; flex: none; width: .75rem; height: .75rem; margin: 0 .5rem .3rem 0;
  border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; opacity: .75; }
.panneau--repliable[open] > summary::after { transform: rotate(-135deg); margin: .3rem .5rem 0 0; }
.panneau--repliable[open] > summary { margin-bottom: .9rem; }

/* --- Une seule teinte par defaut -------------------------------------------------------------
   Les panneaux d'une meme page prenaient chacun la couleur de leur pictogramme (vert, bleu, violet,
   orange...) : l'ecran ressemblait a un nuancier. Desormais : la couleur de la marque partout, le
   vert pour ce qui est verifie ou protege, le rouge pour ce qui est dangereux. */
.panneau:has(> h2 use[href$="#c-plus"]),
.panneau:has(> h2 use[href$="#c-arbre"]),
.panneau:has(> h2 use[href$="#c-utilisateur"]),
.panneau:has(> h2 use[href$="#c-courrier"]),
.panneau:has(> h2 use[href$="#c-entree"]),
.panneau:has(> h2 use[href$="#c-langue"]),
.panneau:has(> h2 use[href$="#c-photo"]),
.panneau:has(> h2 use[href$="#c-palette"]),
.panneau:has(> h2 use[href$="#c-reglages"]),
.panneau:has(> h2 use[href$="#c-crayon"]),
.panneau:has(> h2 use[href$="#c-tarot"]),
.panneau:has(> h2 use[href$="#c-groupe"]),
.panneau:has(> h2 use[href$="#c-telephone"]),
.panneau:has(> h2 use[href$="#c-cube"]),
.panneau:has(> h2 use[href$="#c-tableau"]),
.panneau:has(> h2 use[href$="#c-telecharger"]),
.panneau:has(> h2 use[href$="#c-carte"]),
.panneau:has(> h2 use[href$="#c-cle"]),
.panneau:has(> h2 use[href$="#c-cadenas"]),
.panneau:has(> h2 use[href$="#c-statistiques"]) { --teinte: var(--accent); }
.panneau .icone:has(use[href$="#i-plus"]),
.panneau .icone:has(use[href$="#i-arbre"]),
.panneau .icone:has(use[href$="#i-utilisateur"]),
.panneau .icone:has(use[href$="#i-courrier"]),
.panneau .icone:has(use[href$="#i-entree"]),
.panneau .icone:has(use[href$="#i-langue"]),
.panneau .icone:has(use[href$="#i-photo"]),
.panneau .icone:has(use[href$="#i-palette"]),
.panneau .icone:has(use[href$="#i-reglages"]),
.panneau .icone:has(use[href$="#i-crayon"]),
.panneau .icone:has(use[href$="#i-tarot"]),
.panneau .icone:has(use[href$="#i-groupe"]),
.panneau .icone:has(use[href$="#i-telephone"]),
.panneau .icone:has(use[href$="#i-cube"]),
.panneau .icone:has(use[href$="#i-tableau"]),
.panneau .icone:has(use[href$="#i-telecharger"]),
.panneau .icone:has(use[href$="#i-carte"]),
.panneau .icone:has(use[href$="#i-cle"]),
.panneau .icone:has(use[href$="#i-cadenas"]),
.panneau .icone:has(use[href$="#i-statistiques"]) { color: var(--accent); }

/* --- Etat vide : une icone, une phrase, et le geste qui y remedie ------------------------------- */
.etat-vide { display: grid; justify-items: center; gap: .75rem; padding: 1.75rem 1rem; text-align: center; color: var(--encre-douce); }
.etat-vide p { margin: 0; max-width: 28rem; }
.etat-vide .icone { width: 3rem; height: 3rem; color: var(--accent); opacity: .85; }
li.vide:has(> .etat-vide) { display: block; }
