/* Panneau « Réglages du tirage » (coque et rubriques), commun à tous les modules. */
.voile {
  position: fixed;
  inset: 0;
  z-index: 30;
  border: 0;
  padding: 0;
  background: rgba(30, 24, 14, .3);
  cursor: pointer;
}

.tiroir {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  width: 780px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -6px 0 18px rgba(0, 0, 0, .28);
}

.tete, .pied {
  padding: 10px 18px;
  background: rgba(255, 250, 240, .92);
}

.tete { display: flex; justify-content: space-between; align-items: center; }
.tete h2 { margin: 0; font-size: 1.8rem; }

/* Corps défilant des autres panneaux latéraux (préférences, favoris, rappel des modes…). */
.corps {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Deux colonnes à hauteur stable : la liste des rubriques, puis la rubrique ouverte (seule à défiler). */
.grille-reglages {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}
.liste-rubriques { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.entree-rubrique {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 12px; border: 0; border-radius: 10px; background: rgba(255, 250, 240, .72);
  text-align: left; color: var(--encre); cursor: pointer; font: inherit;
}
.entree-rubrique:hover { background: rgba(255, 250, 240, .92); }
.entree-rubrique.active { background: var(--papier); box-shadow: inset 3px 0 0 var(--rouille), 0 2px 6px rgba(50, 32, 10, .2); }
.entree-rubrique .nom { font-family: var(--police-titre); font-size: 1.12rem; line-height: 1.2; }
.entree-rubrique.active .nom { color: var(--rouille); }
.entree-rubrique .resume { font-family: var(--police-texte); font-size: .78rem; line-height: 1.3; color: var(--encre-douce); }
.entree-rubrique.ameliorer-entree { margin-top: 8px; }
.rubrique-ouverte { min-height: 0; overflow: auto; padding: 4px 8px 10px; }
.rubrique-ouverte .contenu { padding: 4px 2px 8px; }
.contenu .pile, .pile { display: flex; flex-direction: column; gap: 16px; }

/* Panneau étroit (tablette en portrait, téléphone) : les rubriques en onglets au-dessus, sans résumé. */
@media (max-width: 720px) {
  .grille-reglages { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px; }
  .liste-rubriques { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
  .entree-rubrique { flex-shrink: 0; padding: 6px 12px; }
  .entree-rubrique .resume { display: none; }
  .entree-rubrique.active { box-shadow: inset 0 -3px 0 var(--rouille); }
  .entree-rubrique.ameliorer-entree { margin-top: 0; }
}

/* Titre des cartes (« titre nom ») : utilisé dans tout le site. */
.nom { font-size: 1.3rem; }
.resume { font-size: .9rem; color: var(--encre-douce); }

.pied { display: flex; flex-direction: column; gap: 6px; }
.actions { display: flex; justify-content: space-between; align-items: center; }
.erreurs { margin: 0; color: var(--rouge-jeu); font-weight: 600; }

/* « Mes réglages » : une rangée de puces sous le titre (niveau, préréglages nommés, « + Enregistrer »). */
.mes-reglages {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  padding: 6px 18px 10px; background: rgba(255, 250, 240, .92); border-top: 1px solid rgba(172, 167, 118, .45);
}
.libelle-reglages { font-family: var(--police-texte); font-size: .85rem; color: var(--encre-douce); }
.puces-reglages { display: flex; flex-wrap: wrap; gap: 6px; }
.puce-reglage {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(138, 125, 104, .55);
  border-radius: 15px;
  background: rgba(255, 255, 255, .6);
  font-family: var(--police-texte);
  font-size: .88rem;
}
.puce-reglage .charger { border: 0; background: none; padding: 3px 4px 3px 12px; font: inherit; color: var(--encre); cursor: pointer; }
.puce-reglage.puce-niveau .charger { padding-right: 12px; }
.puce-reglage .retirer { border: 0; background: none; padding: 2px 10px 2px 6px; font-size: 1.05rem; line-height: 1; color: var(--encre-douce); cursor: pointer; }
.puce-reglage .retirer:hover { color: var(--rouge-jeu); }
.puce-reglage.choisie { background: #dbe6eb; border-color: #1f3440; }
.puce-reglage.choisie .charger { color: #1f3440; font-weight: 600; }
.puce-reglage.enregistrer { gap: 2px; padding: 0 12px 0 8px; border-style: dashed; color: var(--rouille); font-weight: 600; cursor: pointer; }
.puce-reglage.enregistrer:hover { background: rgba(138, 74, 24, .08); }
.nommer { flex: 1; display: flex; align-items: center; gap: 6px; }
.champ-nom {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border: 1.5px solid var(--pointille);
  border-radius: 8px;
  background: var(--papier);
  font: inherit;
  color: var(--encre);
}
.champ-nom:focus { outline: 2px solid var(--rouille); outline-offset: 1px; }

/* Préférences en panneau latéral : plus large, sur papier crème (le bois est réservé aux réglages du tirage). */
.tiroir-preferences { width: 760px; background: var(--papier); outline: none; }
.tiroir-preferences .actions-tete { display: inline-flex; align-items: center; }
.corps-preferences { background: url("../img/fond.webp") center / cover; }

/* « Je veux m'améliorer » : en bas du panneau, la prochaine étape, la recherche, le questionnaire du module. */
.ameliorer { padding: 6px 2px 8px; display: flex; flex-direction: column; gap: 10px; }
.ameliorer .etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ameliorer .etape { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ameliorer .essayer {
  flex: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 5px 10px;
  border: 1px solid rgba(138, 125, 104, .55);
  border-radius: 16px;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  font-family: var(--police-texte);
}
.ameliorer .essayer.opt { background: #dbe6eb !important; border-color: #1f3440; color: #1f3440 !important; }
.ameliorer .essayer input { margin: 0; align-self: center; }
.ameliorer .reglage { font-size: .8rem; color: var(--encre-douce); }
.ameliorer .champ-recherche {
  font: inherit;
  font-family: var(--police-texte);
  padding: 7px 10px;
  border: 1px solid var(--pointille);
  border-radius: 8px;
  background: #fffdf7;
}
.ameliorer .refaire { align-self: flex-start; }
