:root {
  --fond: #f1f4f2;
  --papier: #ffffff;
  --creux: #e7ece9;
  --trait: #cfd8d3;
  --encre: #14201c;
  --encre-2: #45554f;
  --accent: #0a5f47;
  --accent-fonce: #074634;
  --accent-pale: #dcefe7;
  --attente: #7a4d00;
  --attente-pale: #fdf0cf;
  --alerte: #9c231c;
  --alerte-pale: #fbe3e0;
  --retire: #fbe3e0;
  --ajoute: #d6efdf;
  --rayon: 6px;
  --pas: 0.5rem;
  font-size: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--fond); color: var(--encre); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 0.9375rem/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
}
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
a { color: var(--accent-fonce); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 1.0625rem; font-weight: 650; }
p { margin: 0; }
.discret { color: var(--encre-2); }
.petit { font-size: 0.8125rem; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- cadre */
.bandeau {
  background: var(--encre); color: #eaf1ee;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
  padding: 0.625rem clamp(1rem, 3vw, 2rem);
}
.bandeau .marque { font-weight: 650; color: #fff; text-decoration: none; letter-spacing: -0.005em; }
.bandeau nav { display: flex; flex-wrap: wrap; gap: 0.25rem; flex: 1; }
.bandeau nav a {
  color: #cfdcd6; text-decoration: none; padding: 0.3125rem 0.625rem; border-radius: var(--rayon);
}
.bandeau nav a:hover { background: #24332e; color: #fff; }
.bandeau nav a[aria-current="page"] { background: #2c3f38; color: #fff; }
.bandeau .pastille {
  display: inline-block; min-width: 1.375rem; margin-left: 0.375rem; padding: 0 0.375rem;
  border-radius: 1rem; background: #f3c969; color: #2b1d00; font-size: 0.75rem; font-weight: 650; text-align: center;
}
.bandeau .qui { display: flex; align-items: center; gap: 0.75rem; color: #cfdcd6; font-size: 0.8125rem; }
.bandeau .qui a { color: #cfdcd6; }
.bandeau .qui button { background: none; border: 1px solid #4b5f58; color: #eaf1ee; }
.bandeau .qui button:hover { background: #24332e; }
main { max-width: 78rem; margin: 0 auto; padding: 1.75rem clamp(1rem, 3vw, 2rem) 4rem; }
.tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.25rem; }
.tete p { color: var(--encre-2); }

/* ---------- messages */
.messages { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: 0.5rem; }
.messages li { padding: 0.625rem 0.875rem; border-radius: var(--rayon); border: 1px solid; }
.messages .ok { background: var(--accent-pale); border-color: #a9d3c3; color: #063a2b; }
.messages .erreur { background: var(--alerte-pale); border-color: #eab3ad; color: #6d1712; }

/* ---------- commandes */
button, .bouton {
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.4375rem 0.875rem; border-radius: var(--rayon);
  border: 1px solid var(--trait); background: var(--papier); color: var(--encre);
  text-decoration: none; display: inline-block; line-height: 1.4;
  transition: background-color 150ms, border-color 150ms;
}
button:hover, .bouton:hover { background: var(--creux); border-color: #b4c1bb; }
button:active { background: #dbe3df; }
button.premier { background: var(--accent); border-color: var(--accent); color: #fff; }
button.premier:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
button[disabled] { opacity: 0.55; cursor: not-allowed; }
input[type="text"], input[type="password"], input[type="email"], input[type="search"], input[type="file"], select, textarea {
  font: inherit; color: var(--encre); background: var(--papier);
  border: 1px solid #aebbb5; border-radius: var(--rayon); padding: 0.4375rem 0.625rem; width: 100%;
}
input::placeholder, textarea::placeholder { color: #5b6b65; }
textarea { resize: vertical; line-height: 1.5; }
label { font-weight: 600; display: block; margin-bottom: 0.25rem; }
.champ { margin-bottom: 1rem; }
.champ .aide { font-weight: 400; color: var(--encre-2); font-size: 0.8125rem; }

/* ---------- etiquettes */
.etat, .type {
  display: inline-block; font-size: 0.75rem; font-weight: 650; line-height: 1.5;
  padding: 0 0.5rem; border-radius: 1rem; white-space: nowrap; border: 1px solid transparent;
}
.etat-a_valider { background: var(--attente-pale); color: var(--attente); border-color: #ecd391; }
.etat-a_revoir { background: var(--alerte-pale); color: var(--alerte); border-color: #eab3ad; }
.etat-validee { background: var(--accent-pale); color: var(--accent-fonce); border-color: #a9d3c3; }
.etat-perimee { background: transparent; color: var(--encre-2); border-color: var(--trait); text-decoration: line-through; }
.type { background: transparent; border-color: var(--trait); color: var(--encre-2); font-weight: 600; }
.type-contre-indication { border-color: #e2a39d; color: var(--alerte); }
.type-éviter { border-color: #e6c27a; color: var(--attente); }

/* ---------- file */
.onglets { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--trait); margin-bottom: 1rem; }
.onglets a {
  padding: 0.5rem 0.875rem; text-decoration: none; color: var(--encre-2); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.onglets a:hover { color: var(--encre); }
.onglets a[aria-current="page"] { color: var(--accent-fonce); border-bottom-color: var(--accent); }
.onglets .n { font-weight: 400; margin-left: 0.25rem; }
.filtre { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-bottom: 1rem; }
.filtre input[type="search"] { width: min(24rem, 100%); }
.filtre label { margin: 0; font-weight: 400; display: flex; gap: 0.375rem; align-items: center; }

.table { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 0.75rem; font-weight: 650; color: var(--encre-2); background: var(--creux); padding: 0.4375rem 0.75rem; white-space: nowrap; }
td { padding: 0.625rem 0.75rem; border-top: 1px solid var(--trait); vertical-align: top; }
tbody tr:hover { background: #f7faf8; }
td.textes { width: 62%; }
td.textes a { display: block; color: inherit; text-decoration: none; }
td.textes a:hover .en { text-decoration: underline; }
.en, .fr { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.en { font-weight: 600; }
.fr { color: var(--encre-2); margin-top: 0.125rem; }
.fr.vide { font-style: italic; }
.grappe { display: flex; flex-wrap: wrap; gap: 0.25rem; }
td.statut { white-space: nowrap; }
.vide-file { padding: 2.5rem 1.5rem; text-align: center; }
.vide-file h2 { margin-bottom: 0.375rem; }

/* ---------- fiche */
.fil { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.contexte { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem 2rem; margin: 1rem 0 1.5rem; }
.contexte dt { font-size: 0.75rem; font-weight: 650; color: var(--encre-2); }
.contexte dd { margin: 0.125rem 0 0; }
.regard { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); }
.regard > div { padding: 1.125rem 1.25rem 1.25rem; min-width: 0; }
.regard > div + div { border-left: 1px solid var(--trait); }
.regard h2 { font-size: 0.8125rem; color: var(--encre-2); margin-bottom: 0.625rem; display: flex; justify-content: space-between; gap: 0.5rem; }
.regard .source { font-size: 1.0625rem; line-height: 1.55; max-width: 68ch; overflow-wrap: anywhere; }
.regard textarea { font-size: 1.0625rem; line-height: 1.55; min-height: 9rem; }
.ancien { margin-top: 1.125rem; padding-top: 1rem; border-top: 1px dashed var(--trait); }
.ancien p { line-height: 1.6; max-width: 68ch; }
del { background: var(--retire); color: #6d1712; text-decoration-thickness: 1px; padding: 0 0.125rem; border-radius: 2px; }
ins { background: var(--ajoute); color: #0b4a2b; text-decoration: none; padding: 0 0.125rem; border-radius: 2px; font-weight: 600; }
.types { border: 0; padding: 0; margin: 1.5rem 0 0; }
.types legend { font-weight: 650; padding: 0; margin-bottom: 0.5rem; }
.types .choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.5rem; }
.types label {
  display: grid; grid-template-columns: auto 1fr; gap: 0.125rem 0.5rem; margin: 0; font-weight: 400;
  padding: 0.5rem 0.75rem; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); cursor: pointer;
}
.types label:hover { border-color: #9fb0a8; }
.types label:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); }
.types input { margin: 0.25rem 0 0; accent-color: var(--accent); }
.types strong { font-weight: 650; }
.types span { grid-column: 2; color: var(--encre-2); font-size: 0.8125rem; }
.decision {
  position: sticky; bottom: 0; margin-top: 1.5rem; padding: 0.875rem 0;
  background: linear-gradient(to bottom, transparent, var(--fond) 0.75rem);
  display: grid; grid-template-columns: 1fr auto; gap: 1rem 1.5rem; align-items: end;
}
.decision .boutons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.decision .signature { grid-column: 1 / -1; }
.histoire { margin-top: 2.5rem; }
.histoire ol { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.histoire li { display: grid; grid-template-columns: 9.5rem 10rem 1fr; gap: 0.25rem 1rem; padding: 0.5rem 0; border-top: 1px solid var(--trait); }

/* ---------- pages simples */
.bloc { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.bloc h2 { margin-bottom: 0.5rem; }
.bloc p + p, .bloc p + form, .bloc form + p { margin-top: 0.75rem; }
.bloc form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.bloc form .champ { margin: 0; flex: 1 1 12rem; }
.chiffres { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.chiffres b { font-weight: 650; }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--creux); padding: 0.125rem 0.375rem; border-radius: 3px; user-select: all; }
.porte { max-width: 23rem; margin: 12vh auto 0; }
.porte h1 { margin-bottom: 0.375rem; }
.porte > p { margin-bottom: 1.5rem; }
.pages { display: flex; justify-content: space-between; margin-top: 1rem; }
td.agir form { display: inline; }
td.agir button { padding: 0.1875rem 0.5rem; font-size: 0.8125rem; }

@media (max-width: 52rem) {
  .regard { grid-template-columns: 1fr; }
  .regard > div + div { border-left: 0; border-top: 1px solid var(--trait); }
  .decision { grid-template-columns: 1fr; position: static; background: none; }
  .bandeau nav { order: 3; flex-basis: 100%; }
  .bandeau .qui { margin-left: auto; }
  .histoire li { grid-template-columns: 1fr; gap: 0; }
  .table { overflow-x: auto; }
  td.textes { min-width: 18rem; }
  th.second, td.second { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
