:root {
  --ink: #111827;
  --text: #374151;
  --grey: #6b7280;
  --line: #e5e7eb;
  --faint: #f3f4f6;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--blue); text-underline-offset: 2px; }

img, svg { display: block; max-width: 100%; height: auto; }

.label {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--grey);
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 16px;
  font-size: 42px;
  line-height: 1.12;
}

h2 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.2;
}

h3 { margin: 0 0 6px; font-size: 20px; }

p { margin: 0 0 14px; color: var(--text); }

.key {
  font-size: 21px;
  line-height: 1.4;
  font-weight: bold;
  color: var(--ink);
}

.small { font-size: 15px; color: var(--grey); }

.lead { font-size: 21px; line-height: 1.45; color: var(--ink); }

h3.sub { margin-top: 28px; }

.fig-wide { max-width: 720px; }

header { padding: 56px 0 8px; }

nav ul {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 15px;
}

section {
  padding: 48px 0 8px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

figure { margin: 24px 0; }

figcaption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--grey);
  line-height: 1.45;
}

.hero-img img {
  width: 100%;
  border-radius: 6px;
  background: var(--faint);
}

.fig-narrow { max-width: 460px; }
.fig-mid { max-width: 640px; }

svg text { font-family: Arial, Helvetica, sans-serif; }

/* Cartes de trois colonnes */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.col { border-top: 4px solid var(--line); padding-top: 14px; }
.col.blue { border-top-color: var(--blue); }
.col p { margin: 0; }

/* Légendes */
.legend { list-style: none; margin: 16px 0; padding: 0; }
.legend li { display: flex; gap: 12px; align-items: baseline; margin-bottom: 10px; color: var(--text); }
.swatch {
  flex: none;
  width: 18px;
  height: 18px;
  position: relative;
  top: 3px;
  border-radius: 3px;
}

/* Tableaux */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
}

th {
  text-align: left;
  font-weight: normal;
  font-size: 14px;
  color: var(--grey);
  padding: 6px 14px 8px 0;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text);
}

td:first-child { font-weight: bold; color: var(--ink); }
tr.us td { color: var(--blue); font-weight: bold; }

/* Phases */
.phases {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.phases li {
  background: var(--faint);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.35;
}

.phases .n { display: block; color: var(--grey); font-size: 13px; }
.phases .t { display: block; font-weight: bold; color: var(--ink); }
.phases .d { display: block; color: var(--grey); }
.phases li.stop { border-color: var(--blue); }
.phases li.decide { background: var(--blue-light); border-color: var(--blue); }

.chips {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.chips li {
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--grey);
}

.chips li b { display: block; color: var(--ink); font-size: 16px; }
.chips li.main { background: var(--blue-light); border-color: var(--blue); }

ul.plain { padding-left: 20px; margin: 0 0 14px; color: var(--text); }
ul.plain li { margin-bottom: 6px; }

.status {
  border-left: 4px solid var(--blue);
  background: var(--faint);
  padding: 16px 18px;
  border-radius: 0 6px 6px 0;
  margin: 20px 0;
}

.status p:last-child { margin-bottom: 0; }

.sources { font-size: 15px; }
.sources h3 { font-size: 16px; margin-top: 20px; }
.sources ul { padding-left: 18px; margin: 6px 0; }
.sources li { margin-bottom: 4px; color: var(--text); }

footer {
  margin-top: 48px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--grey);
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  header { padding-top: 32px; }
  h1 { font-size: 31px; }
  h2 { font-size: 25px; }
  .key { font-size: 19px; }
  .lead { font-size: 19px; }
  section { padding-top: 36px; margin-top: 28px; }

  /* Tableaux en fiches empilées */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  td { border: 0; padding: 2px 0; }
  td[data-h]::before {
    content: attr(data-h) " : ";
    color: var(--grey);
    font-weight: normal;
  }
}
