/* Site benchmark Seelink : une colonne de lecture, des tuiles pour l'état, des cartes pour chaque objet à traiter */
:root {
  --bg: #F3F5F2; --surface: #FFFFFF; --fg: #18211C; --muted: #5A665F; --line: #D6DDD7;
  --accent: #2F6B4F; --accent-soft: #E1EEE6;
  --n0: #A23B2C; --n0-soft: #F7E3DF; --n1: #9A5B00; --n1-soft: #F8ECD8;
  --n2: #5F7A1E; --n2-soft: #EBF1DA; --n3: #1E7A4C; --n3-soft: #DDF1E5;
  --warn-soft: #FBF0DF;
  --display: "Literata", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #111613; --surface: #18201B; --fg: #E3EAE5; --muted: #9AA8A0; --line: #2C3832;
  --accent: #6FBF95; --accent-soft: #17302A;
  --n0: #EC8577; --n0-soft: #3A1C18; --n1: #E3A94F; --n1-soft: #33270F;
  --n2: #B5CF6A; --n2-soft: #283012; --n3: #5CC48D; --n3-soft: #132D20;
  --warn-soft: #33270F; color-scheme: dark } }
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 16px; line-height: 1.55 }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.muet { color: var(--muted); font-size: .92rem }

.haut { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5 }
.haut-in { max-width: 62rem; margin: 0 auto; padding: .6rem max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center }
.marque { font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--fg); text-decoration: none }
.marque span { color: var(--accent) }
.nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1 1 auto }
.nav a { text-decoration: none; color: var(--muted); padding: .3rem .6rem; border-radius: 6px; font-weight: 500; font-size: .95rem }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft) }
.qui { display: flex; gap: .6rem; align-items: center; font-size: .88rem; color: var(--muted); margin: 0 }
.lien { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline }

.wrap { max-width: 62rem; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 1.6rem 4rem; display: grid; gap: 1.3rem }
.titre { display: grid; gap: .4rem }
.sur { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 }
h1 { font-family: var(--display); font-weight: 600; font-size: 2rem; line-height: 1.2; margin: 0; text-wrap: balance }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.3; margin: 0 0 .6rem; text-wrap: balance }
h3 { font-size: 1.02rem; margin: 0; line-height: 1.35 }
.chapo { color: var(--muted); margin: 0; max-width: 68ch; font-size: 1.04rem }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.2rem; min-width: 0 }
.note-cadre { background: var(--accent-soft); border-color: transparent }
.pile { display: grid; gap: .6rem }
.alerte { background: var(--warn-soft); border-radius: 6px; padding: .6rem .9rem; margin: 0 }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem }
.tuile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .9rem 1rem; display: grid; gap: .15rem; text-decoration: none; color: var(--fg); align-content: start }
a.tuile:hover { border-color: var(--accent) }
.chiffre { font-family: var(--display); font-size: 1.9rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent) }
.chiffre small { font-size: 1rem; color: var(--muted) }
.pastille { justify-self: start; font-size: .78rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px }
.p1 { background: var(--n1-soft); color: var(--n1) }

.jalons { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .4rem }
.jalons li { display: flex; gap: .6rem; align-items: baseline }
.coche { flex: 0 0 1.2rem; height: 1.2rem; border-radius: 50%; border: 1.5px solid var(--line); display: inline-grid; place-items: center; font-size: .75rem; color: var(--surface); transform: translateY(.2rem) }
.jalons li.fait .coche { background: var(--accent); border-color: var(--accent) }
.jalons li:not(.fait) { color: var(--muted) }

.liste-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem }
.doc { text-decoration: none; color: var(--fg) }
.doc:hover { border-color: var(--accent) }
.doc p { margin: 0; color: var(--muted) }

.btn { font: 600 .92rem var(--sans); padding: .5rem .95rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); cursor: pointer }
.btn.ghost { background: transparent; color: var(--accent) }
.btn:disabled { opacity: .45; cursor: not-allowed }
input, select, textarea { font: inherit; width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg) }
textarea { resize: vertical }
label { font-weight: 600; font-size: .9rem }
.connexion { max-width: 26rem; justify-self: center; width: 100%; display: grid; gap: .6rem }

/* Décisions */
.filtres { display: flex; flex-wrap: wrap; gap: .4rem }
.puce { font: 500 .88rem var(--sans); padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer }
.puce.actif { border-color: var(--accent); background: var(--accent-soft); color: var(--accent) }
.section-dec { display: grid; gap: .7rem }
.decision { display: grid; gap: .5rem }
.decision p, .decision ul { margin: 0; max-width: 72ch }
.decision ul { padding-left: 1.2rem }
.decision-tete { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap }
.decision-tete h3 { flex: 1 1 18rem }
.code { font: 500 .85rem var(--mono); color: var(--muted) }
.statut { font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; white-space: nowrap }
.s-en_attente { background: var(--line); color: var(--fg) }
.s-valide { background: var(--n3-soft); color: var(--n3) }
.s-a_modifier { background: var(--n1-soft); color: var(--n1) }
.decision[data-statut="valide"] { border-left: 3px solid var(--n3) }
.decision[data-statut="a_modifier"] { border-left: 3px solid var(--n1) }
.fil { border-left: 2px solid var(--line); padding-left: .8rem; display: grid; gap: .4rem; font-size: .93rem }
.fil p { margin: 0 }
.actions { display: grid; gap: .4rem }
.boutons { display: flex; flex-wrap: wrap; gap: .4rem }
.histo { font-size: .88rem; color: var(--muted) }
.histo ul { margin: .3rem 0 0; padding-left: 1.1rem }
.etat-save { position: sticky; bottom: .6rem; justify-self: center; margin: 0; background: var(--fg); color: var(--bg); padding: .35rem .8rem; border-radius: 6px; font-size: .88rem }
.etat-save:empty { display: none }

/* Documents */
.doc-md { max-width: 52rem; overflow-wrap: anywhere }
.doc-md h1 { font-size: 1.8rem; margin: .4rem 0 .8rem }
.doc-md h2 { margin-top: 1.8rem }
.doc-md h3 { margin-top: 1.2rem }
.doc-md p, .doc-md li { max-width: 72ch }
.doc-md table { border-collapse: collapse; font-size: .92rem; display: block; overflow-x: auto; max-width: 100% }
.doc-md th, .doc-md td { border-bottom: 1px solid var(--line); padding: .35rem .6rem; text-align: left; vertical-align: top }
.doc-md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .7rem .9rem; overflow-x: auto; font-size: .85rem }
.doc-md code { font-family: var(--mono); font-size: .88em }
.doc-md blockquote { border-left: 3px solid var(--accent); margin: .8rem 0; padding: .2rem .9rem; color: var(--muted) }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: .2rem 0 }

/* Résultats */
.recherche { margin-top: .6rem }
.run summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline }
.run-nom { font-weight: 600 }
.run[open] summary { margin-bottom: .7rem }
#runs { display: grid; gap: .5rem }
.defile { overflow-x: auto }
table { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums }
th, td { border-bottom: 1px solid var(--line); padding: .35rem .6rem; text-align: left; white-space: nowrap }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600 }
.num { text-align: right }
td.grave { color: var(--n0); font-weight: 600 }
.croise td.diag { background: var(--accent-soft); font-weight: 600 }

/* Grille */
dl.grille { display: grid; grid-template-columns: 2rem 1fr; gap: .5rem .8rem; margin: 0 }
dl.grille dt { font: 500 1.15rem var(--mono) }
dl.grille dd { margin: 0; max-width: 70ch }
.n0 { color: var(--n0) } .n1 { color: var(--n1) } .n2 { color: var(--n2) } .n3 { color: var(--n3) }
.defs { margin: .8rem 0 0; padding-left: 1.1rem; font-size: .92rem; color: var(--muted); display: grid; gap: .25rem }

/* Notation */
.status { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .92rem; font-variant-numeric: tabular-nums }
.bar { flex: 1 1 12rem; height: .45rem; background: var(--line); border-radius: 999px; overflow: hidden }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s }
.save { color: var(--muted); font-size: .85rem }
.save.err { color: var(--n0) }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6rem, 1fr)); gap: .35rem }
.chip { font: 500 .8rem var(--mono); padding: .35rem 0; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; position: relative }
.chip[data-n="0"] { background: var(--n0-soft); color: var(--n0); border-color: transparent }
.chip[data-n="1"] { background: var(--n1-soft); color: var(--n1); border-color: transparent }
.chip[data-n="2"] { background: var(--n2-soft); color: var(--n2); border-color: transparent }
.chip[data-n="3"] { background: var(--n3-soft); color: var(--n3); border-color: transparent }
.chip.cur { outline: 2px solid var(--fg); outline-offset: 1px }
.chip.hes::after { content: "?"; position: absolute; top: -.35rem; right: -.2rem; font-size: .7rem; background: var(--n1); color: var(--surface); border-radius: 999px; width: .95rem; height: .95rem; display: grid; place-items: center }
.fiche { display: grid; gap: .9rem }
.fiche-tete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem }
.label { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 0 0 .3rem }
.produit { font-family: var(--display); font-weight: 500; font-size: 1.3rem; margin: 0 }
.produit.vide { color: var(--muted); font-style: italic; font-size: 1.05rem }
pre.texte { font-family: var(--mono); font-size: .92rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px dashed var(--line); border-radius: 6px; padding: .8rem .9rem; margin: 0; max-height: 22rem; overflow-y: auto }
.raisons { display: grid; gap: .7rem }
.groupe { display: grid; gap: .3rem }
.groupe h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600 }
.groupe[data-n="x"] h3 { color: var(--muted) }
.opts { display: flex; flex-wrap: wrap; gap: .4rem }
.opt { display: inline-flex; align-items: flex-start; gap: .4rem; font-size: .88rem; font-weight: 400; line-height: 1.35; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; max-width: 100% }
.opt input { width: auto; margin: .15rem 0 0; accent-color: var(--accent) }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft) }
.notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem }
.nbtn { font: inherit; text-align: left; padding: .6rem .7rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; display: grid; gap: .15rem; min-width: 0 }
.nbtn b { font-family: var(--mono); font-size: 1.35rem; line-height: 1 }
.nbtn span { font-size: .8rem; color: var(--muted); line-height: 1.3 }
.nbtn[aria-pressed="true"] { border-width: 2px }
.nbtn[data-n="0"] b { color: var(--n0) } .nbtn[data-n="1"] b { color: var(--n1) } .nbtn[data-n="2"] b { color: var(--n2) } .nbtn[data-n="3"] b { color: var(--n3) }
.nbtn[aria-pressed="true"][data-n="0"] { background: var(--n0-soft); border-color: var(--n0) }
.nbtn[aria-pressed="true"][data-n="1"] { background: var(--n1-soft); border-color: var(--n1) }
.nbtn[aria-pressed="true"][data-n="2"] { background: var(--n2-soft); border-color: var(--n2) }
.nbtn[aria-pressed="true"][data-n="3"] { background: var(--n3-soft); border-color: var(--n3) }
.suggest { margin: 0; font-size: .92rem; color: var(--muted) }
.suggest strong { color: var(--fg) }
.hes { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; font-weight: 400 }
.hes input { width: auto; margin-top: .3rem; accent-color: var(--n1) }
.hes small { display: block; color: var(--muted) }
.nav-fiche { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center }
.kbd { font-size: .8rem; color: var(--muted) }
kbd { font-family: var(--mono); font-size: .75rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 .3rem; background: var(--surface) }
.fin { background: var(--accent-soft); border-color: transparent }
.desaccord { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; display: grid; gap: .4rem }
.desaccord p { margin: 0 }

@media (max-width: 560px) { h1 { font-size: 1.55rem } .notes { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (prefers-reduced-motion: reduce) { .bar > i { transition: none } }
