/* Updated 2026-11-02 (plan "Alicia lecture seule", lot 2). Mobile first (375 px), one column; from 600 px a tableau is a table again.
   Colours are tokens; a state is never told by colour alone (every state also has a word). No inline style anywhere (CSP). */
:root {
  --fond: #f4f4f1; --carte: #ffffff; --texte: #1c1c20; --doux: #4f4f58; --bord: #cfcfca;
  --accent: #2b59c3; --sur-accent: #ffffff;
  --vert: #1c6b3e; --vert-fond: #e1f1e8;
  --jaune: #7a5b00; --jaune-fond: #fbf0c6;
  --orange: #a34508; --orange-fond: #fde6d4;
  --rouge: #a8221b; --rouge-fond: #fbe1de;
  --gris: #54545c; --gris-fond: #e9e9e6;
  --neutre: #3d3d45; --neutre-fond: #efefec;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not(.theme-clair) {
    --fond: #131316; --carte: #1c1c21; --texte: #ececf0; --doux: #b3b3bd; --bord: #3a3a42;
    --accent: #8fb0ff; --sur-accent: #101018;
    --vert: #8fd6ac; --vert-fond: #1d3326; --jaune: #f1d36a; --jaune-fond: #3a3213;
    --orange: #ffb27a; --orange-fond: #402a18; --rouge: #ff9d95; --rouge-fond: #432120;
    --gris: #b3b3bd; --gris-fond: #2a2a30; --neutre: #d6d6de; --neutre-fond: #26262c;
  }
}
:root.theme-sombre {
  --fond: #131316; --carte: #1c1c21; --texte: #ececf0; --doux: #b3b3bd; --bord: #3a3a42;
  --accent: #8fb0ff; --sur-accent: #101018;
  --vert: #8fd6ac; --vert-fond: #1d3326; --jaune: #f1d36a; --jaune-fond: #3a3213;
  --orange: #ffb27a; --orange-fond: #402a18; --rouge: #ff9d95; --rouge-fond: #432120;
  --gris: #b3b3bd; --gris-fond: #2a2a30; --neutre: #d6d6de; --neutre-fond: #26262c;
}
/* The accent never takes the colour of a state (red, yellow, orange, green, grey). */
.accent-bleu { --accent: #2b59c3; }
.accent-violet { --accent: #7a3fc4; }
.accent-rose { --accent: #b8327f; }
.accent-turquoise { --accent: #0b7a85; }
:root.theme-sombre.accent-bleu, :root.theme-sombre .accent-bleu { --accent: #8fb0ff; }
:root.theme-sombre.accent-violet, :root.theme-sombre .accent-violet { --accent: #c9a2ff; }
:root.theme-sombre.accent-rose, :root.theme-sombre .accent-rose { --accent: #ff9fd0; }
:root.theme-sombre.accent-turquoise, :root.theme-sombre .accent-turquoise { --accent: #6fdbe6; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
body.vieille { filter: grayscale(1); }
a { color: var(--accent); }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--neutre-fond); padding: 0 0.25em; border-radius: 3px; }
h1 { font-size: 1.15rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
p { margin: 0.35rem 0; }
ul, ol { margin: 0.35rem 0; padding-left: 1.25rem; }

.entete { display: flex; align-items: center; gap: 12px; padding: 4px 16px; background: var(--carte); border-bottom: 1px solid var(--bord); }
.entete .compte { margin: 0 0 0 auto; font-size: 0.85rem; color: var(--doux); }
.entete form { margin: 0; }
.bouton {
  font: inherit; font-size: 0.9rem; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--carte); color: var(--accent);
  text-decoration: none; display: inline-flex; align-items: center; cursor: pointer;
}
.bouton.gros { background: var(--accent); color: var(--sur-accent); font-size: 1.05rem; padding: 0 20px; }
.bouton:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.chargee { margin: 4px 16px 0; font-size: 0.78rem; color: var(--doux); }
main { padding: 0 16px 24px; max-width: 960px; margin: 0 auto; }
.simple { padding-top: 24px; }

.bandeau { margin: 8px 16px; padding: 8px 12px; border: 2px solid var(--orange); background: var(--orange-fond); color: var(--texte); border-radius: 8px; font-size: 0.9rem; }
.bandeau.vieux { border-color: var(--gris); background: var(--gris-fond); font-weight: 600; }
.bandeau[hidden] { display: none; }

/* The five lines */
.cinq { margin-top: 4px; }
details.ligne { background: var(--carte); border: 1px solid var(--bord); border-left-width: 6px; border-radius: 8px; margin: 4px 0; }
details.ligne > summary { list-style: none; cursor: pointer; padding: 6px 10px; min-height: 44px; display: block; font-size: 0.94rem; line-height: 1.35; }
details.ligne > summary::-webkit-details-marker { display: none; }
details.ligne > summary::after { content: " ▾"; color: var(--doux); }
details.ligne[open] > summary::after { content: " ▴"; }
.etiquette { font-weight: 700; margin-right: 4px; }
.phrase { display: inline; }
.suite { color: var(--doux); }
.puce { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 1px 6px; border-radius: 10px; border: 1px solid currentColor; vertical-align: 1px; margin-right: 4px; }
.corps { padding: 2px 12px 10px; border-top: 1px dashed var(--bord); }
.corps ul.elements { list-style: none; padding: 0; }
.corps ul.elements > li { margin: 8px 0; padding-bottom: 6px; border-bottom: 1px solid var(--bord); }

.teinte-vert { border-left-color: var(--vert); } .teinte-vert .puce { color: var(--vert); background: var(--vert-fond); }
.teinte-jaune { border-left-color: var(--jaune); } .teinte-jaune .puce { color: var(--jaune); background: var(--jaune-fond); }
.teinte-orange { border-left-color: var(--orange); } .teinte-orange .puce { color: var(--orange); background: var(--orange-fond); }
.teinte-rouge { border-left-color: var(--rouge); } .teinte-rouge .puce { color: var(--rouge); background: var(--rouge-fond); }
.teinte-gris { border-left-color: var(--gris); } .teinte-gris .puce { color: var(--gris); background: var(--gris-fond); }
.teinte-neutre { border-left-color: var(--neutre); }

.source { font-size: 0.8rem; color: var(--doux); margin: 4px 0; }
.echec { color: var(--rouge); font-weight: 600; }
.masque { font-size: 0.85rem; color: var(--orange); font-weight: 600; }
.reste, .tronque { font-size: 0.85rem; color: var(--doux); }

/* Machines */
ul.machines { list-style: none; padding: 0; display: grid; gap: 8px; }
.machine { border: 1px solid var(--bord); border-left-width: 6px; border-radius: 8px; padding: 6px 10px; background: var(--fond); }
.machine .nom { margin: 0; }
.machine dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 4px 0 0; font-size: 0.9rem; }
.machine dt { color: var(--doux); }
.machine dd { margin: 0; }
.fraicheur { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0 6px; border-radius: 10px; border: 1px solid currentColor; }
.fraicheur.fraiche { color: var(--vert); background: var(--vert-fond); }
.fraicheur.palie { color: var(--jaune); background: var(--jaune-fond); }
.fraicheur.grise, .badge-sans { color: var(--gris); background: var(--gris-fond); }
.badge-sans { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 0 6px; border-radius: 10px; border: 1px solid currentColor; }
.machine.teinte-vert, .machine.teinte-jaune, .machine.teinte-gris { }
.empreinte { cursor: help; }

/* Blocks below the five lines */
.bloc { margin-top: 18px; }
ul.grille { list-style: none; padding: 0; }
ul.grille > li { padding: 6px 8px 6px 10px; margin: 5px 0; background: var(--carte); border: 1px solid var(--bord); border-left-width: 6px; border-radius: 8px; }
.marque { display: inline-block; min-width: 1.2em; font-weight: 700; }
details.aide, details.repli { margin: 8px 0; }
details > summary { cursor: pointer; min-height: 32px; }
.puce-aide { display: inline-block; width: 22px; height: 22px; line-height: 20px; text-align: center; border: 1px solid var(--accent); color: var(--accent); border-radius: 50%; font-weight: 700; }
blockquote { margin: 6px 0; padding: 4px 12px; border-left: 4px solid var(--accent); background: var(--neutre-fond); border-radius: 0 8px 8px 0; }
.decision { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; padding: 2px 12px; }
.reglage { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.pied { padding: 12px 16px 28px; font-size: 0.8rem; color: var(--doux); max-width: 960px; margin: 0 auto; }

/* Markdown output */
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--neutre-fond); padding: 8px; border-radius: 6px; font-size: 0.85rem; }
pre code { background: none; padding: 0; }
.tableau table { border-collapse: collapse; width: 100%; }
.tableau th, .tableau td { border: 1px solid var(--bord); padding: 4px 8px; text-align: left; vertical-align: top; }

/* Under 600 px a table becomes a stack of cards */
@media (max-width: 599px) {
  .tableau table, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tableau tr { margin: 8px 0; border: 1px solid var(--bord); border-radius: 8px; background: var(--carte); }
  .tableau td { border: 0; border-bottom: 1px solid var(--bord); }
  .tableau td:last-child { border-bottom: 0; }
  .tableau td::before { content: attr(data-label); display: block; font-size: 0.75rem; color: var(--doux); font-weight: 700; }
}
@media (min-width: 600px) {
  ul.machines { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (min-width: 1000px) {
  body { font-size: 17px; }
}
