:root {
  --fond: #f6f5f2; --carte: #ffffff; --texte: #1f2328; --doux: #66707a; --ligne: #e3e1dc;
  --accent: #b5541c; --accent-texte: #ffffff; --ok: #1e7b4a; --err: #b42318;
  --pro: #1d5fa8; --perso: #7a3fb0; --mixte: #2f7d6d; --revoir: #a15c00;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #16181b; --carte: #1f2226; --texte: #e8e6e3; --doux: #9aa3ab; --ligne: #30343a;
          --accent: #e07a3c; --accent-texte: #16181b; --ok: #5cc28c; --err: #ff7b72;
          --pro: #6ea8ec; --perso: #c193ec; --mixte: #6cc3b0; --revoir: #e8a443; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte);
       font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; background: var(--ligne); padding: 0 .3em; border-radius: 4px; }
.tete { position: sticky; top: 0; z-index: 2; background: var(--carte); border-bottom: 1px solid var(--ligne);
        display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; padding: .6rem 1rem; }
.marque { font-weight: 700; letter-spacing: .02em; color: var(--texte); text-decoration: none; }
.tete nav { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.tete nav a { white-space: nowrap; text-decoration: none; color: var(--doux); padding: .3rem .6rem; border-radius: 6px; }
.tete nav a.actif { color: var(--texte); background: var(--fond); font-weight: 600; }
.pastille { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 999px; background: var(--accent); color: var(--accent-texte);
            font-size: .75em; text-align: center; font-weight: 700; }
main { max-width: 860px; margin: 0 auto; padding: 1rem; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: .3rem 0 .6rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; }
.discret { color: var(--doux); font-size: .92rem; }
.ok { color: var(--ok); font-weight: 600; }
.erreur { color: var(--err); font-weight: 600; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 1.2rem; }
.connexion { max-width: 420px; margin: 8vh auto 0; }
.pile { display: flex; flex-direction: column; gap: .8rem; }
.ligne { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--doux); }
label.case { flex-direction: row; align-items: center; gap: .35rem; }
input, select, textarea, button { font: inherit; color: var(--texte); }
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; padding: .55rem .65rem; background: var(--carte);
       border: 1px solid var(--ligne); border-radius: 8px; }
textarea { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92rem; resize: vertical; }
button, .bouton { display: inline-block; padding: .55rem 1rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-texte);
                  font-weight: 600; cursor: pointer; text-decoration: none; }
button.secondaire, .bouton.secondaire { background: var(--ligne); color: var(--texte); }
button.danger { background: transparent; color: var(--err); border: 1px solid var(--err); }
button.petit { padding: .25rem .6rem; font-size: .85rem; }
form.enligne { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.recherche { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-bottom: .6rem; }
@media (min-width: 700px) { .recherche { grid-template-columns: 1fr auto auto auto auto; align-items: center; } }
.resultats { display: flex; flex-direction: column; gap: .6rem; }
.resultat { display: flex; flex-direction: column; gap: .15rem; background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px;
            padding: .75rem .9rem; color: var(--texte); text-decoration: none; }
.resultat:hover { border-color: var(--accent); }
.resultat .sujet, .fiche .sujet { font-size: .8rem; color: var(--doux); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.resultat .titre { font-weight: 650; }
.resultat .extrait { color: var(--doux); font-size: .9rem; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: 0; }
.badge { font-size: .75rem; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--ligne); color: var(--doux); }
.d-pro { color: var(--pro); border-color: currentColor; } .d-perso { color: var(--perso); border-color: currentColor; }
.d-mixte { color: var(--mixte); border-color: currentColor; } .s-revoir { color: var(--revoir); border-color: currentColor; }
.s-provisoire, .s-obsolete, .s-supprime { color: var(--err); border-color: currentColor; }
.date { font-size: .78rem; color: var(--doux); margin-left: auto; }
.fiche .contenu, .depot .contenu { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: .4rem 1rem; margin: .8rem 0;
                                   overflow-wrap: anywhere; }
.contenu h3 { font-size: 1.05rem; margin: 1rem 0 .3rem; } .contenu h4 { font-size: .98rem; margin: .8rem 0 .2rem; }
.contenu ul { padding-left: 1.2rem; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; font-size: .9rem; }
.meta dt { color: var(--doux); } .meta dd { margin: 0; overflow-wrap: anywhere; }
.versions { padding-left: 1.2rem; font-size: .92rem; }
.journal { width: 100%; border-collapse: collapse; font-size: .9rem; }
.journal th, .journal td { text-align: left; padding: .4rem .3rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.journal td:first-child { white-space: nowrap; color: var(--doux); }
.filtres a { margin-right: .6rem; text-decoration: none; } .filtres a.actif { font-weight: 700; text-decoration: underline; }
.depot { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: .6rem .9rem; margin-bottom: .6rem; }
.p-importe { color: var(--ok); border-color: currentColor; } .p-a_importer, .p-en_cours { color: var(--revoir); border-color: currentColor; }
