:root {
  --fond: #f4f1ea;
  --papier: #fffdf8;
  --encre: #1f1d1a;
  --discret: #6b665d;
  --trait: #ddd6c8;
  --accent: #1f4e79;
  --rouge: #c00000;
  --rouge-fond: #f4cccc;
  --orange: #a35f00;
  --orange-fond: #ffe5b4;
  --ombre: 0 1px 2px rgba(31, 29, 26, .06), 0 4px 16px rgba(31, 29, 26, .06);
  --rayon: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--encre);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); }
button, input, select { font: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.entete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: var(--papier); border-bottom: 1px solid var(--trait); }
.marque { font-weight: 700; }
.marque small { display: block; font-weight: 400; font-size: 12px; color: var(--discret); }
.etapes { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--discret); }
.etapes li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 20px; }
.etapes b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--trait); color: var(--encre); font-size: 12px; }
.etapes li[aria-current="step"] { color: var(--encre); font-weight: 600; }
.etapes li[aria-current="step"] b { background: var(--accent); color: #fff; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px; }
.carte-etape { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 24px; }
h1 { font-size: 24px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 10px; }
.intro { color: var(--discret); line-height: 1.6; margin: 0 0 18px; max-width: 760px; }

.depot { position: relative; display: grid; gap: 4px; justify-items: center; text-align: center; padding: 34px 16px;
  border: 2px dashed #9aa9bb; border-radius: var(--rayon); background: #f6f8fb; color: #4a5866; cursor: pointer; }
.depot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.depot b { font-size: 17px; color: var(--encre); }
.depot small { margin-top: 6px; }
.depot.survol { border-color: var(--accent); background: #eef3fa; }
.liste-fichiers { list-style: none; padding: 0; margin: 12px 0; font-size: 14px; display: grid; gap: 4px; }
.liste-fichiers li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: #f6f4ee; border-radius: 6px; }
.liste-fichiers .etat { color: var(--discret); white-space: nowrap; }
.message { padding: 10px 12px; border-radius: 8px; background: var(--rouge-fond); color: #7a0000; font-size: 14px; }
.message.attention { background: var(--orange-fond); color: #5c3600; }
.avis { font-weight: 600; margin: 16px 0 8px; }
.barre { height: 8px; background: var(--trait); border-radius: 4px; overflow: hidden; }
.barre i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

.bouton { border: 1px solid var(--trait); background: #fff; color: var(--encre); border-radius: 8px; padding: 9px 16px; cursor: pointer; margin: 10px 8px 0 0; }
.bouton:hover { border-color: var(--discret); }
.bouton.principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton:disabled { opacity: .45; cursor: default; }
.bouton.lien { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 9px 4px; }
.bouton:focus-visible, td button:focus-visible { outline: 3px solid #8ab4e8; outline-offset: 1px; }

.titre-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
#recherche { flex: 1; max-width: 380px; padding: 8px 12px; border: 1px solid var(--trait); border-radius: 8px; background: #fff; }
.legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--discret); margin: 0 0 12px; }
.pastille { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: -8px; }
.pastille.rouge { background: var(--rouge-fond); border: 1px solid var(--rouge); }
.pastille.orange { background: var(--orange-fond); border: 1px solid var(--orange); }
.aide { color: var(--discret); font-size: 13px; }
.tableau-defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--discret); padding: 8px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
td { border-bottom: 1px solid #eee; padding: 2px; vertical-align: top; }
td.fichier { padding: 8px; color: var(--discret); min-width: 130px; max-width: 220px; overflow-wrap: anywhere; }
td button { width: 100%; text-align: left; border: 1px solid transparent; background: none; padding: 7px 8px; border-radius: 6px; cursor: pointer; color: var(--encre); }
td button:hover { border-color: var(--trait); background: #faf8f2; }
td button.incertain { background: var(--rouge-fond); color: #8a0000; }
td button.absent { background: var(--orange-fond); color: #5c3600; font-style: italic; }
td button small { display: block; font-size: 11px; color: var(--discret); font-style: normal; }

.deux-colonnes { display: grid; grid-template-columns: minmax(280px, 1fr) 1.3fr; gap: 24px; margin-top: 16px; }
.criteres { padding-left: 22px; margin: 0 0 10px; }
.criteres li { margin: 4px 0; }
.criteres li span { display: inline-block; min-width: 150px; }
.criteres button { border: 1px solid var(--trait); background: #fff; border-radius: 6px; width: 30px; height: 28px; cursor: pointer; margin-left: 2px; }
.ajout-critere { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; margin-bottom: 14px; }
.ajout-critere select { padding: 8px; border: 1px solid var(--trait); border-radius: 8px; margin-top: 10px; background: #fff; }
.arbre { margin: 0; padding: 14px; background: #f6f4ee; border-radius: 8px; font-family: Consolas, Menlo, monospace; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 460px; overflow: auto; }

.panneau { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--papier); border-left: 1px solid var(--trait);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .12); padding: 18px; overflow-y: auto; z-index: 30; }
.panneau-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panneau-tete .bouton { margin: 0; }
.raison { font-size: 14px; }
.raison.incertain { color: var(--rouge); }
.raison.absent { color: var(--orange); }
.source { position: relative; border: 1px solid var(--trait); border-radius: 6px; overflow: hidden; margin-top: 8px; background: #fff; }
.source img { display: block; width: 100%; }
.source .zone { position: absolute; border: 3px solid var(--accent); background: rgba(31, 78, 121, .12); border-radius: 3px; }
.correction { display: grid; gap: 6px; font-size: 14px; margin-top: 12px; }
.correction input { padding: 8px 10px; border: 1px solid var(--trait); border-radius: 8px; }

.pied { max-width: 1180px; margin: 0 auto; padding: 0 20px 30px; font-size: 13px; color: var(--discret); }

@media (max-width: 760px) {
  main { padding: 16px; }
  .carte-etape { padding: 16px; }
  .deux-colonnes { grid-template-columns: 1fr; }
  .etapes li { padding: 4px 6px; }
  h1 { font-size: 20px; }
}
