/* Charte ManEka : bleu nuit, turquoise, doré. Polices du système : aucun appel extérieur. */
:root {
  --fond: #f5f7fa; --carte: #ffffff; --texte: #0a2540; --doux: #4d6076; --trait: #d5dde7;
  --accent: #0e7c72; --accent-fond: #e2f5f2; --or: #8a6d1f; --or-fond: #f8f1dd; --danger: #a12b2b; --danger-fond: #fdecec;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #071a2e; --carte: #0e2742; --texte: #eaf0f7; --doux: #a9b8ca; --trait: #26425f;
    --accent: #45d1c1; --accent-fond: #103a44; --or: #e0c377; --or-fond: #33301f; --danger: #ff9d9d; --danger-fond: #3d1c1c; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 28px; }
section { display: flex; flex-direction: column; gap: 12px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; }
h2 { font-size: 1.2rem; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
.entete { background: #0a2540; color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.marque { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.marque span { font-weight: 400; color: #e0c377; margin-left: 6px; }
.sortie { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.sortie .lien { color: #9fe6dc; }
.pied { max-width: 760px; margin: 0 auto; padding: 16px; color: var(--doux); font-size: .85rem; border-top: 1px solid var(--trait); }
.etroit { max-width: 440px; }
.pile { display: flex; flex-direction: column; gap: 8px; }
.rangee { display: flex; flex-wrap: wrap; gap: 8px; }
label { font-weight: 600; font-size: .92rem; }
input[type=email], input[name=code], textarea { font: inherit; color: var(--texte); background: var(--carte); border: 1.5px solid var(--trait); border-radius: 8px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; line-height: 1.5; }
.code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; max-width: 240px; font-variant-numeric: tabular-nums; }
button, .bouton { font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1.5px solid var(--trait); background: var(--carte); color: var(--texte); text-decoration: none; display: inline-flex; align-items: center; }
button.principal, .bouton.principal { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { button.principal, .bouton.principal { color: #06222a; } }
button.danger { color: var(--danger); border-color: var(--danger); }
button.lien { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font-weight: 400; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.message { background: var(--accent-fond); padding: 10px 14px; border-radius: 8px; }
.erreur { background: var(--danger-fond); color: var(--danger); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.discret { color: var(--doux); font-size: .88rem; }
.vide { color: var(--doux); font-style: italic; }
.compte { font-size: .85rem; background: var(--or-fond); color: var(--or); border-radius: 99px; padding: 2px 10px; margin-left: 6px; font-weight: 600; }
.liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste > li > a, .liste.simple > li { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--texte); }
.liste > li > a:hover { border-color: var(--accent); }
.ligne-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.liste .titre { font-weight: 600; font-size: 1.05rem; }
.etat { display: inline-block; font-size: 1rem; font-weight: 700; padding: 6px 14px; border-radius: 99px; white-space: nowrap; background: var(--or-fond); color: var(--or); border: 1.5px solid var(--or); }
.etat-a_lire { background: var(--carte); color: var(--doux); border-color: var(--doux); }
.etat-en_cours { background: var(--or-fond); color: var(--or); border-color: var(--or); }
.etat-prete { background: var(--accent-fond); color: var(--accent); border-color: var(--accent); }
.etat-rendue { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-color-scheme: dark) { .etat-rendue { color: #06222a; } }
.marche { background: var(--carte); border: 1px solid var(--trait); border-left: 4px solid var(--accent); border-radius: 10px; padding: 16px; }
.marche ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.appel { margin-top: 4px; }
.question { background: var(--carte); border: 1px solid var(--trait); border-left: 4px solid var(--or); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.question.repondue { border-left-color: var(--accent); }
.question button { align-self: flex-start; }
.q-texte { font-weight: 600; }
.choix { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.choix.vertical { flex-direction: column; }
.choix label, .case { font-weight: 400; font-size: 1rem; display: flex; gap: 8px; align-items: flex-start; min-height: 32px; }
.choix input, .case input { margin-top: 6px; flex: none; width: 18px; height: 18px; }
fieldset { border: 1px solid var(--trait); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.fiche { gap: 0; }
.passage { padding: 10px 0; border-bottom: 1px dashed var(--trait); display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 12px; }
.texte.barre { text-decoration: line-through; color: var(--doux); }
.texte.modifie { border-left: 4px solid var(--accent); padding-left: 12px; }
.passage.edition { background: var(--carte); border: 2px solid var(--accent); border-radius: 10px; padding: 14px; margin: 8px 0; }
.passage.edition textarea { font-size: 1rem; }
.repere { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: .88rem; background: var(--accent-fond); padding: 6px 12px; border-radius: 8px; }
.repere-suppression { background: var(--danger-fond); color: var(--danger); }
.origine summary { cursor: pointer; color: var(--doux); font-size: .88rem; }
.origine .texte { color: var(--doux); padding: 8px 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-start; }
.action { font-size: .9rem; min-height: 32px; display: inline-flex; align-items: center; font-weight: 600; }
.actions .outils[open] { flex: 1 1 100%; }
.texte { max-width: 68ch; overflow-wrap: anywhere; }
.texte > * { margin: 0 0 8px; }
.texte > *:last-child { margin-bottom: 0; }
.texte h2, .texte h3, .texte h4, .texte h5, .texte h6 { line-height: 1.25; }
.texte h2 { font-size: 1.35rem; } .texte h3 { font-size: 1.15rem; } .texte h4 { font-size: 1.05rem; }
.texte ul, .texte ol { padding-left: 22px; }
.texte blockquote { border-left: 4px solid var(--or); background: var(--or-fond); padding: 8px 12px; margin-left: 0; margin-right: 0; border-radius: 0 6px 6px 0; }
.texte code { background: var(--accent-fond); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.texte pre { overflow-x: auto; background: var(--carte); border: 1px solid var(--trait); padding: 10px; border-radius: 6px; }
.tableau { overflow-x: auto; }
table { border-collapse: collapse; font-size: .92rem; min-width: 100%; }
th, td { border: 1px solid var(--trait); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--accent-fond); }
.outils summary { cursor: pointer; color: var(--accent); font-size: .9rem; min-height: 32px; display: flex; align-items: center; }
.outils[open] { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 16px; }
.outils form + form { margin-top: 14px; }
.retour { border-radius: 8px; padding: 10px 12px; background: var(--accent-fond); display: flex; flex-direction: column; gap: 6px; }
.retour-suppression { background: var(--danger-fond); }
.retour-commentaire { background: var(--or-fond); }
.retour-tete { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.avis { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 16px; }
@media print { .outils, .entete form, button { display: none; } }

/* Lot 2 : documents, demandes, décisions */
input[type=text], input[type=url], select { font: inherit; color: var(--texte); background: var(--carte); border: 1.5px solid var(--trait); border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px; }
input[type=file] { font: inherit; max-width: 100%; }
.liste.simple li form { flex: none; }
.liste.simple li a.titre { overflow-wrap: anywhere; }
.etat-demande-retenue, .etat-demande-faite { background: var(--accent-fond); color: var(--accent); border-color: var(--accent); }
.etat-demande-refusee { background: var(--danger-fond); color: var(--danger); border-color: var(--danger); }
.etat-demande-nouvelle { background: var(--carte); color: var(--doux); border-color: var(--doux); }
.decision { display: inline-block; align-self: flex-start; font-size: .88rem; font-weight: 700; padding: 3px 12px; border-radius: 99px; }
.decision.oui { background: var(--accent); color: #fff; }
.decision.non { background: var(--danger-fond); color: var(--danger); border: 1.5px solid var(--danger); }
@media (prefers-color-scheme: dark) { .decision.oui { color: #06222a; } }
.decider { align-items: center; }
.decider button:disabled { opacity: .45; cursor: default; }

/* Encadré des documents et liens : bien visible */
.documents { background: var(--or-fond); border: 2px solid var(--or); border-radius: 12px; padding: 18px; scroll-margin-top: 12px; }
.documents h2 { font-size: 1.3rem; }
.documents h3 { font-size: 1.05rem; }
.deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 14px; min-width: 0; }
/* Lot 3 : pilotage des recherches */
.rangee { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
select.petit { width: auto; min-height: 36px; padding: 4px 8px; font-size: .9rem; }
button.petit { min-height: 36px; padding: 4px 12px; font-size: .9rem; white-space: nowrap; }
td.chiffre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.alerte { font-weight: 700; color: var(--danger); }
tr.groupe th { background: var(--or-fond); color: var(--or); font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
main:has(.compagnon) { max-width: 1100px; }
.compagnon td:first-child { min-width: 260px; }
.compagnon td .rangee { flex-wrap: nowrap; }
.compagnon { scroll-margin-top: 12px; border-top: 2px solid var(--trait); padding-top: 18px; }
.compagnon h2 .discret { font-size: .95rem; font-weight: 400; margin-left: 6px; }
.sommaire { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.sommaire p { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.sommaire a { min-height: 32px; display: inline-flex; align-items: center; }
a.bouton { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 8px; border: 1.5px solid var(--accent); color: var(--accent); font-weight: 600; text-decoration: none; }
.etat-rech-demandee { background: var(--or-fond); color: var(--or); border-color: var(--or); }
.etat-rech-en_cours, .etat-rech-faite { background: var(--accent-fond); color: var(--accent); border-color: var(--accent); }
.etat-rech-annulee { background: var(--carte); color: var(--doux); border-color: var(--doux); }
/* Lot 4 : membres */
fieldset.cases { border: 1px solid var(--trait); border-radius: 10px; padding: 10px 14px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
fieldset.cases legend { font-weight: 600; padding: 0 6px; }
fieldset.cases p { margin: 4px 0 0; }
input[type=date] { font: inherit; color: var(--texte); background: var(--carte); border: 1.5px solid var(--trait); border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px; }
.alerte-texte { color: var(--danger); font-weight: 700; }
main:has(#creer), main:has(#programme) { max-width: 1000px; }
/* Dictée */
.dictee { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
button.micro { min-height: 36px; padding: 4px 14px; font-size: .9rem; border-radius: 99px; border-color: var(--accent); color: var(--accent); }
button.micro::before { content: "🎤"; margin-right: 6px; }
button.micro.ecoute { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Tableau de bord d'un conseiller */
.bord { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 16px 18px; }
.bord h2 { margin-top: 0; }
.tuiles { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.tuiles li { background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.tuiles .nombre { font-size: 1.9rem; font-weight: 700; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.tuiles .discret { font-size: .85rem; }
.reperes { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }

/* Menu du membre : en haut sur petit écran, à gauche sur grand écran */
.avec-menu, .avec-menu .contenu { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.menu-membre ul { list-style: none; margin: 0; padding: 8px; display: flex; flex-wrap: wrap; gap: 4px; background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; }
.menu-membre a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 4px 12px; border-radius: 8px; text-decoration: none; color: var(--texte); font-weight: 600; }
.menu-membre a:hover, .menu-membre a:focus-visible { background: var(--accent-fond); }
main:has(.avec-menu) { max-width: 1040px; }
@media (min-width: 900px) {
  .avec-menu { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
  .menu-membre { position: sticky; top: 16px; }
  .menu-membre ul { flex-direction: column; flex-wrap: nowrap; }
}
html { scroll-behavior: smooth; scroll-padding-top: 12px; }
