/* Note — carnet éditorial, 24 septembre 2026.
   Couche de présentation : les vues, données et mutations restent dans index.html. */
:root {
  color-scheme: light;
  --fond-page: #e8e5dc;
  --fond-scene: #e8e5dc;
  --fond-cellule: #fffefa;
  --fond-cellule-3: #f7f5f0;
  --remplissage: #e7e7df;
  --remplissage-2: #efeee8;
  --fond-surface: #f5f3ed;
  --remplissage-4: #f5f3ed;
  --filet: #dfdfd7;
  --bordure: #dfdfd7;
  --encre: #282c29;
  --encre-corps: #30342f;
  --texte-secondaire: #666e67;
  --texte-doux: #737872;
  --estompe: #737872;
  --tertiaire: #969b94;
  --accent: #b9523b;
  --accent-fonce: #953c2c;
  --accent-fond: #f4e4dc;
  --accent-encre: #fff;
  --accent-texte: #8c382b;
  --lien: #8c382b;
  --ia-texte: #554b90;
  --ia-fond: #efecf8;
  --ia-fond-carte: #f7f4fe;
  --ia-bordure: #d8d1ec;
  --chaud-bordure: #d8a18f;
  --chaud-bordure-douce: #ead1c5;
  --etiquette-texte: #8c382b;
  --surface-chaude: #f4e4dc;
  --sauge: #526c5d;
  --vert-systeme: #60756a;
  --attente: #a55d20;
  --attente-fond: #fbf0df;
  --danger: #a93434;
  --danger-fond: #fbebea;
  --danger-bordure: #e9b7b5;
  --surligne: #f8e6aa;
  --fond-compte: #e9e8e0;
  --rail-fond: #d7d9cf;
  --rail-actif: #60756a;
  --fond-code: #f1efe7;
  --selection: #e9c8b8;
  --materiau-fin: #f7f6f1;
  --materiau: #fbfaf6;
  --materiau-epais: #fffefa;
  --flou-leger: none;
  --flou: none;
  --flou-fort: none;
  --voile: rgba(40, 44, 41, .34);
  --ombre-modale: 0 20px 70px rgba(42, 44, 39, .18);
  --ombre-fab: 0 7px 18px rgba(149, 60, 44, .22);
  --police-serif: "Iowan Old Style", "New York", Georgia, serif;
}

body { font-size: 15px; line-height: 1.5; }
.calque-fond { background: var(--fond-page); }
button, input, textarea, select { font-family: var(--police-sans); }
.marque { letter-spacing: -.07em; }
.marque .domaine { font: 600 12px var(--police-sans); letter-spacing: 0; }
.pastille { background: var(--ia-texte); }
.champ-recherche, .champ-mdp, .champ-projet, .choix-parent select,
.panneau-liens-pages input {
  border: 1px solid var(--filet);
  background: var(--fond-cellule);
  border-radius: 10px;
  font-size: 14px;
}
.champ-recherche::placeholder, .champ-mdp::placeholder { color: #90958e; }
.btn, .btn-vue, .btn-propositions { border-radius: 10px; letter-spacing: 0; }
.btn-propositions, .statut-enregistrement, .ligne-etat, .etat,
.note-date, .intro-propositions, .lien-discret, .chargement { font-family: var(--police-sans); }
.btn-propositions { text-transform: none; font-size: 13px; }
.titre-page, .message-centre .grande-ligne {
  font-family: var(--police-serif);
  font-weight: 550;
  letter-spacing: -.035em;
}
.titre-page { font-size: clamp(36px, 4.5vw, 54px); line-height: 1.1; margin: 6px 0 15px; }
.message-centre .grande-ligne { font-size: 30px; line-height: 1.2; }
.intro-propositions { font-size: 16px; line-height: 1.5; }
.carte-proposition { border: 1px solid var(--ia-bordure); border-radius: 13px; }
.barre-haut { min-height: 48px; border-bottom: 1px solid var(--filet); padding-bottom: 8px; margin-bottom: 22px; }
.btn-texte, .btn-retour, .btn-texte-danger { font-size: 14px; font-weight: 650; }
.formulaire-note { border: 0; border-radius: 0; background: transparent; padding: 0; gap: 16px; }
.champ-titre {
  font-family: var(--police-serif);
  font-size: clamp(39px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 550;
  min-height: 72px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--filet);
  display: block;
  overflow: hidden;
  resize: none;
}
.champ-titre::placeholder { font-style: normal; color: #a7aaa3; }
.champ-contenu, .apercu-contenu {
  font-family: var(--police-serif);
  font-size: 19px;
  line-height: 1.55;
  letter-spacing: -.012em;
}
.apercu-contenu h1, .apercu-contenu h2, .apercu-contenu h3 {
  font-family: var(--police-serif);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
}
.apercu-contenu h1 { font-size: 34px; }
.apercu-contenu h2 { font-size: 27px; }
.apercu-contenu h3 { font-size: 22px; }
.apercu-contenu blockquote { border-left-color: var(--accent); background: #f9eee8; border-radius: 0 9px 9px 0; padding: 12px 16px; }
.apercu-contenu .bloc-md { background: #f9f6f0; }
.barre-outils-markdown { border-color: var(--filet); }
.outil-markdown { color: var(--texte-secondaire); }
.ligne-etat { color: var(--sauge); font-size: 12px; letter-spacing: 0; }
.barre-enregistrer { background: var(--materiau); border-top-color: var(--filet); }
.statut-enregistrement { text-transform: none; letter-spacing: 0; font-size: 12px; }
.liens-note { border: 1px solid var(--filet); background: var(--fond-cellule); }

/* Dossiers et pages : deux pictogrammes de même famille, sans glyphes système. */
.arbre-pages { padding: 5px 0; }
.arbre-ligne {
  min-height: 36px;
  padding: 2px 5px 2px calc(5px + var(--retrait, 0px));
  gap: 5px;
  border-radius: 8px;
  margin: 2px 0;
}
.arbre-ligne:hover { background: #eeece5; }
.arbre-ligne.active { background: var(--accent-fond); }
.arbre-icone { flex: 0 0 19px; width: 19px; height: 19px; color: #888f86; }
.arbre-icone-dossier { color: var(--sauge); }
.arbre-ligne.active .arbre-icone-page { color: var(--accent-texte); }
.arbre-bascule, .arbre-espace { flex: 0 0 21px; width: 21px; height: 34px; }
.arbre-bascule { font-size: 12px; color: #89918a; border-radius: 6px; }
.arbre-bascule:hover { background: var(--accent-fond); color: var(--accent-texte); }
.arbre-titre { font-size: 13px; font-weight: 550; color: var(--encre); }
.arbre-titre.ouverte { color: var(--accent-texte); font-weight: 750; }
.arbre-dossier .arbre-titre { font-weight: 700; }
.arbre-ajouter { flex: 0 0 30px; width: 30px; height: 34px; line-height: 34px; opacity: 0; font-size: 18px; }
.arbre-ligne:hover .arbre-ajouter, .arbre-ajouter:focus-visible { opacity: 1; }
.mode-liste button { border-color: var(--filet); background: transparent; font-size: 12px; min-height: 35px; }
.mode-liste button[aria-pressed="true"] { border-color: #e5cec2; }
#zone-notes { border-radius: 10px; border: 1px solid var(--filet); }
.arbre-pages { background: var(--fond-cellule); }
.ligne-note { background: var(--fond-cellule); }
.ligne-note.ouverte { background: var(--accent-fond); }
.note-titre { font-family: var(--police-serif); font-size: 17px; font-weight: 600; }
.note-date { font-size: 11px; }
.panneau-filtres > summary { justify-content: space-between; border: 1px solid var(--filet); background: var(--fond-cellule); font-size: 13px; min-height: 38px; }
.resume-filtres { font-size: 11px; }
.pages-entete { display: flex; align-items: center; justify-content: space-between; margin: 12px 7px 4px; color: var(--texte-secondaire); font: 800 10px var(--police-sans); letter-spacing: .13em; text-transform: uppercase; }
.pages-entete .ligne-compte { margin: 0; color: var(--texte-secondaire); font: 600 11px var(--police-sans); letter-spacing: 0; text-transform: none; }

/* Bas de l'écran mobile, dans le même esprit que la maquette. */
.navigation-mobile {
  position: fixed;
  z-index: 23;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  min-height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--filet);
  background: var(--materiau);
}
.navigation-mobile a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--texte-secondaire);
  font: 650 11px var(--police-sans);
}
.navigation-mobile a.actif, .navigation-mobile a[aria-current="page"] { color: var(--accent-texte); }
.navigation-mobile svg { width: 22px; height: 22px; }
.conteneur { background: var(--fond-cellule); padding-bottom: calc(154px + env(safe-area-inset-bottom)); }
.fab { display: none; }
.barre-enregistrer { bottom: calc(58px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
.voile-connexion { z-index: 50; }

/* Le volet d'accompagnement reprend les données réelles des liens. */
.note-inspecteur[hidden] { display: none !important; }
.note-inspecteur { display: none; }
.inspecteur-legende, .inspecteur-codex-label {
  color: var(--texte-secondaire);
  font: 800 10px var(--police-sans);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.inspecteur-plan, .inspecteur-codex, .inspecteur-liens { margin-top: 20px; }
.inspecteur-plan { padding: 14px; border: 1px solid var(--filet); border-radius: 11px; background: var(--fond-cellule); }
.inspecteur-plan h2, .inspecteur-liens h2 { font: 750 12px var(--police-sans); margin-bottom: 10px; }
.inspecteur-plan p { display: flex; gap: 9px; margin: 9px 0; color: var(--texte-secondaire); font-size: 12px; line-height: 1.4; }
.inspecteur-plan p span { color: var(--accent); }
.inspecteur-plan .inspecteur-vide { font-size: 11px; }
.inspecteur-codex { padding: 18px; border: 1px solid var(--ia-bordure); border-radius: 12px; background: var(--ia-fond-carte); }
.inspecteur-codex-label { color: var(--ia-texte); }
.inspecteur-codex h2 { margin: 14px 0 8px; font: 600 25px/1.12 var(--police-serif); }
.inspecteur-codex > p:not(.inspecteur-codex-label) { color: var(--texte-secondaire); font-size: 12px; line-height: 1.5; }
.inspecteur-codex a { display: flex; justify-content: space-between; margin: 16px 0 12px; padding: 9px 11px; border-radius: 8px; background: var(--ia-texte); color: white; font-size: 12px; font-weight: 750; }
.inspecteur-codex small { font-size: 10px; color: var(--ia-texte); }
.inspecteur-liens { padding: 0; border: 0; background: transparent; }
.inspecteur-liens p { margin: 8px 0 5px; font-size: 11px; }
.inspecteur-liens a { display: block; padding: 7px 9px; border: 1px solid var(--filet); border-radius: 7px; background: var(--fond-cellule); font-size: 12px; text-decoration: none; }

@media (min-width: 760px) and (max-width: 1079px) {
  .conteneur { max-width: 780px; padding: 26px 36px 130px; }
}

@media (min-width: 1080px) {
  body { padding: 0 16px 16px; background: var(--fond-page); }
  .barre-sync { height: 42px; min-height: 42px; padding: 8px 14px; border: 0; background: transparent; text-align: right; color: var(--sauge); }
  .coquille, .coquille.volet-ouvert {
    grid-template-columns: 258px minmax(0, 1fr);
    border: 1px solid #e0dfd8;
    border-radius: 18px;
    background: var(--fond-cellule);
    box-shadow: 0 20px 70px rgba(42,44,39,.12), 0 2px 12px rgba(42,44,39,.05);
    overflow: hidden;
  }
  .nav-bureau {
    grid-column: 1;
    grid-row: 1;
    padding: 24px 16px 16px;
    background: #f0eee7;
    border-right: 1px solid var(--filet);
    backdrop-filter: none;
  }
  .nav-bureau .marque { order: 0; padding: 0 9px 20px; font-size: 27px; letter-spacing: -.07em; line-height: 1; color: var(--encre); text-decoration: none; }
  .nav-bureau .nav-lien[data-vue="carnet"] { display: none; }
  .nav-bureau .marque .domaine { margin-left: 5px; }
  .nav-bureau .nav-lien[href="#/nouvelle"] {
    order: 1;
    min-height: 44px;
    margin-bottom: 12px;
    padding: 0 13px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    box-shadow: 0 6px 12px rgba(173,71,46,.13);
  }
  .nav-bureau .nav-lien[href="#/nouvelle"]::before {
    content: "+";
    display: grid;
    place-items: center;
    width: 21px;
    height: 21px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 5px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
  }
  .nav-bureau .nav-lien[href="#/nouvelle"] kbd { margin-left: auto; color: rgba(255,255,255,.72); background: none; border: 0; }
  .nav-bureau .nav-separation { order: 2; min-height: 190px; }
  .nav-bureau .nav-lien:not([href="#/nouvelle"]) { order: 3; min-height: 28px; padding: 3px 10px; font-size: 12px; }
  .nav-bureau .nav-lien.actif:not([href="#/nouvelle"]) { color: var(--accent-texte); background: var(--accent-fond); }
  .nav-bureau .lien-discret { order: 4; padding-left: 10px; min-height: 27px; font: 650 11px var(--police-sans); letter-spacing: 0; text-transform: none; }
  .coquille.volet-ouvert .volet-lateral {
    position: absolute;
    z-index: 2;
    display: flex;
    top: 112px;
    bottom: 165px;
    left: 15px;
    width: 228px;
    border: 0;
    background: transparent;
    overflow: hidden;
  }
  .volet-entete { padding: 0; }
  .volet-defilant { padding: 0 0 8px; }
  .volet-entete .champ-recherche { height: 40px; min-height: 40px; margin-bottom: 0; }
  .volet-entete .panneau-filtres { margin-top: 7px; }
  .volet-entete .mode-liste { padding-top: 7px; }
  .volet-entete .ligne-compte { margin: 8px 6px 1px; font-size: 11px; }
  .coquille.volet-disponible .btn-volet,
  .coquille.volet-ouvert .btn-volet {
    top: 15px;
    left: 244px;
    background: var(--fond-cellule);
    box-shadow: none;
    border-radius: 8px;
  }
  .conteneur {
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid var(--filet);
    padding: 30px clamp(28px, 4vw, 54px) 50px;
    background: var(--fond-cellule);
  }
  #app > * { max-width: 760px; }
  .barre-enregistrer { bottom: -50px; padding-bottom: 10px; background: #fbfaf6; }
  .navigation-mobile { display: none; }
  .coquille.volet-ouvert #zone-notes { border: 0; background: transparent; }
  .coquille.volet-ouvert .arbre-pages { background: transparent; }
  .coquille.volet-ouvert .ligne-note { border-radius: 8px; margin: 3px 0; }
  .coquille.volet-ouvert .ligne-note::after { display: none; }
}

@media (min-width: 1200px) {
  .coquille.avec-inspecteur, .coquille.avec-inspecteur.volet-ouvert {
    grid-template-columns: 258px minmax(0, 1fr) 282px;
  }
  .coquille.avec-inspecteur .note-inspecteur:not([hidden]) {
    display: block;
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 25px 20px 30px;
    border-left: 1px solid var(--filet);
    background: #fbfaf6;
  }
  .coquille.avec-inspecteur #app > .liens-note { display: none; }
  .coquille.avec-inspecteur .conteneur { padding-left: 38px; padding-right: 38px; }
}

@media (max-width: 1079px) {
  .barre-sync { background: var(--materiau); }
  .conteneur { min-height: 100dvh; }
  .ligne-marque { margin-bottom: 18px; }
  .ligne-marque .marque { font-size: 31px; }
  #zone-notes { border-radius: 11px; }
  .arbre-ligne { min-height: 44px; }
  .arbre-bascule, .arbre-espace { height: 44px; }
  .arbre-ajouter { opacity: 1; }
  .barre-enregistrer { bottom: calc(58px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .conteneur { padding: 22px 22px calc(160px + env(safe-area-inset-bottom)); }
  .champ-titre { font-size: clamp(38px, 10vw, 54px); }
  .champ-contenu, .apercu-contenu { font-size: 18px; }
  .ligne-etat { flex-wrap: wrap; }
  .barre-haut { justify-content: flex-start; gap: 4px; }
  .barre-haut .btn-retour, .barre-haut .btn-texte, .barre-haut .btn-texte-danger {
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
    white-space: nowrap;
  }
  .navigation-mobile a { min-height: 58px; }
}
