:root {
  --texte: #000;
  --fond: #fff;
  --panneau: #e4eaf1;
  --actif: #90caf9;
  --accent: #1976d2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Bahnschrift", "DIN Alternate", "Roboto", "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  color: var(--texte);
  background: var(--fond);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- En-tête ---------- */
header { padding: 14px 40px 28px; }

header h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 42px;
  letter-spacing: .5px;
}

/* ---------- Mise en page ---------- */
.page {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding-left: 19px;
}

nav { width: 200px; flex-shrink: 0; }

nav a {
  display: block;
  padding: 15px 15px 15px 15px;
  height: 50px;
  color: var(--texte);
  text-decoration: none;
  font-weight: 700;
}
nav a:hover { background: #f1f5f9; }
nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

nav a[aria-current="page"] {
  background: var(--actif);
  border-left: 5px solid var(--accent);
  padding-left: 15px;
}
nav a:not([aria-current]) { padding-left: 15px; }

main {
  flex: 1;
  min-width: 0;
  background: var(--panneau);
  padding: 40px;
  display: flex;
  flex-direction: column;
}

main h2 {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  margin-bottom: 20px;
}

main p { margin-bottom: 20px; }
main p:last-child { margin-bottom: 0; }

/* ---------- Calculateur ---------- */
.calcul {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: stretch;
  flex: 1;
}

.champ { margin-bottom: 22px; }
.champ label { display: block; margin-bottom: 8px; }

select, input[type="range"] { width: 100%; }

select {
  padding: 8px;
  border: 1px solid #aab4c2;
  border-radius: 2px;
  background: #fff;
  font: inherit;
}

input[type="range"] { accent-color: var(--accent); }

button.calculer {
  width: 100%;
  padding: 11px;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
button.calculer:hover { background: #1565c0; }
button.calculer:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

.graphique {
  position: relative;
  min-height: 560px;
  background: #fff;
}
.graphique .zone { position: absolute; inset: 8px; }
.graphique svg { display: block; width: 100%; height: 100%; }
.graphique text { font-family: inherit; fill: #000; }
.graphique .pt { fill: #fff; stroke: #1e3a8a; stroke-width: 1.5; }
.graphique .point.actif .pt { fill: #1e3a8a; r: 6; }
.graphique .point circle { cursor: crosshair; }
.bulle {
  display: none;
  position: absolute;
  z-index: 5;
  padding: 6px 10px;
  background: #000;
  color: #fff;
  font-size: 14px;
  line-height: 19px;
  white-space: nowrap;
  pointer-events: none;
  border-radius: 2px;
}

@media (max-width: 800px) {
  .page { flex-direction: column; padding-left: 0; }
  nav { width: 100%; display: flex; overflow-x: auto; }
  nav a { white-space: nowrap; height: auto; }
  nav a[aria-current="page"] { border-left: 0; border-bottom: 4px solid var(--accent); }
  header { padding: 14px 20px; }
  main { padding: 24px 20px; width: 100%; }
  .calcul { grid-template-columns: 1fr; }
}

/* ---------- Tableaux ---------- */
table.tableau {
  border-collapse: collapse;
  background: #fff;
  min-width: 380px;
}
.tableau th,
.tableau td {
  padding: 6px 28px;
  text-align: center;
}
.tableau th {
  font-weight: 700;
  border: 1px solid #000;
  border-left-width: 0;
}
.tableau th:first-child { border-left-width: 1px; text-align: left; }
.tableau td { border-bottom: 1px solid #000; font-weight: 600; }
.tableau td:first-child { text-align: left; }
.tableau-defile { overflow-x: auto; }

/* Variante : seulement un trait sous l'en-tête et sous la dernière ligne */
.tableau.simple th { border-width: 1px 0; }
.tableau.simple th:first-child { text-align: center; border-left-width: 0; }
.tableau.simple td { border-bottom: 0; font-weight: 500; }
.tableau.simple tbody tr:last-child td { border-bottom: 1px solid #000; }
.tableau.simple td:first-child { text-align: left; }

main h3 { font-size: 18px; font-weight: 700; margin: 36px 0 14px; }

/* ---------- Tableaux côte à côte ---------- */
.cote-a-cote {
  display: flex;
  flex-wrap: wrap;          /* passe l'un sous l'autre si la largeur manque */
  align-items: flex-start;
  gap: 32px 56px;
}
.cote-a-cote h4 { margin-top: 0; }

/* Mention à confirmer : italique, gras, rouge */
.a-confirmer {
  font-style: italic;
  font-weight: 700;
  color: #c62828;
}