:root {
  --fond: #f7f6f2; --texte: #1f2328; --doux: #5b6168; --trait: #d9d6cc;
  --accent: #2f5d8a; --blocage: #b4441f; --mesure: #2e7d4f; --relever: #8a8f96; --carte: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #16181b; --texte: #e6e3dc; --doux: #9aa0a6; --trait: #33373d;
    --accent: #7fb0e0; --blocage: #ef8a63; --mesure: #6fcf97; --relever: #7b8189; --carte: #1e2125;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
header, main { max-width: 860px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 28px; }
h1 { margin: 0; font-size: 1.7rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.sous, #moi { color: var(--doux); margin: .2rem 0; }
.question { font-size: 1.15rem; font-style: italic; margin-top: 1.5rem; }
.regle { color: var(--doux); }
code { font-size: 1.25rem; padding: 2px 8px; background: var(--carte); border: 1px solid var(--trait); border-radius: 6px; }
button { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--fond); cursor: pointer; }
button.discret { background: transparent; color: var(--accent); }
.etat { color: var(--doux); min-height: 1.5em; }
.choix { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.choix button[aria-checked="false"] { background: transparent; color: var(--accent); }
.etapes { list-style: none; padding: 0; display: grid; gap: 8px; }
.etapes li { background: var(--carte); border: 1px solid var(--trait); border-left: 5px solid var(--relever);
  border-radius: 6px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.etapes li.mesure { border-left-color: var(--mesure); }
.etapes li.partiel { border-left-color: var(--accent); }
.etapes .nom { font-weight: 600; }
.etapes .valeur { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.etapes .valeur.vide { color: var(--relever); font-weight: 400; }
.etapes .note { grid-column: 1 / -1; color: var(--doux); font-size: .92rem; }
.etat-badge { font-size: .8rem; color: var(--doux); }
.frise { list-style: none; padding: 0; border-left: 2px solid var(--trait); margin-left: 6px; }
.frise li { position: relative; padding: 4px 0 10px 18px; }
.frise li::before { content: ""; position: absolute; left: -7px; top: 10px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--fond); border: 2px solid var(--accent); }
.frise li.blocage::before { border-color: var(--blocage); background: var(--blocage); }
.frise li.incident::before { border-color: var(--relever); }
.frise .h { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 8px; }
.frise .tag { font-size: .8rem; padding: 1px 6px; border-radius: 10px; margin-left: 6px; border: 1px solid currentColor; }
.frise .tag.b { color: var(--blocage); } .frise .tag.i, .frise .tag.e, .frise .tag.s { color: var(--doux); }
.filtre { color: var(--doux); font-size: .95rem; }
.notes { color: var(--doux); }
.pied { margin: 2.5rem 0; color: var(--doux); }
h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
.onglets { display: flex; gap: 8px; flex-wrap: wrap; margin: 1.5rem 0 .5rem; }
.onglets button[aria-pressed="false"] { background: transparent; color: var(--accent); }
.formulaire { display: grid; gap: 10px; }
.formulaire label { display: grid; gap: 4px; color: var(--doux); font-size: .95rem; }
input, textarea, select { font: inherit; color: var(--texte); background: var(--carte);
  border: 1px solid var(--trait); border-radius: 6px; padding: 6px 8px; width: 100%; }
#c-texte { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.membres { width: 100%; border-collapse: collapse; }
.membres th { text-align: left; font-weight: 600; font-size: .85rem; color: var(--doux); padding: 4px; }
.membres td { padding: 3px 4px; vertical-align: top; }
.membres td:last-child { width: 1%; }
.ecarts { list-style: none; padding: 0; }
.ecarts li::before { content: "○ "; color: var(--relever); }
.ecarts li.ok::before { content: "● "; color: var(--mesure); }
.ecarts li.manque::before { content: "● "; color: var(--blocage); }
@media (max-width: 640px) {
  .membres thead { display: none; }
  .membres tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-bottom: 1px solid var(--trait); padding: 6px 0; }
  .membres td:last-child { width: auto; }
}
#k-texte { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.ancienne { white-space: pre-wrap; background: var(--carte); border: 1px solid var(--trait); border-radius: 6px; padding: 10px; font-size: .88rem; }
