/* feuille de style unique. Typographie système, une couleur d'accent, pas d'ombres. */
:root {
  --fond: #F7F6F2;
  --surface: #FFFFFF;
  --encre: #1B1B18;
  --gris: #6B6A63;
  --gris-clair: #E4E2DB;
  --ligne: #D8D5CC;
  --accent: #E8590C;
  --accent-fonce: #C2410C;
  --accent-pale: #FDEBDD;
  --alerte: #B42318;
  --rayon: 4px;
  --largeur: 1060px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--fond);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: var(--accent-fonce); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 6vw, 40px); font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; }
input, select, textarea { font-size: 16px; }

/* ----- en-tête et pied ----- */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--largeur); margin: 0 auto; padding: 14px 16px;
}
.marque {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--encre); text-decoration: none;
}
.marque::before {
  content: ""; width: 7px; height: 22px; background: var(--encre);
  border-top: 8px solid var(--accent); box-sizing: content-box; margin-right: 0;
}
.entete nav { display: flex; gap: 18px; font-size: 15px; }
.entete nav a { color: var(--gris); text-decoration: none; }
.entete nav a:hover { color: var(--encre); text-decoration: underline; }
.pied {
  max-width: var(--largeur); margin: 56px auto 0; padding: 20px 16px 36px;
  border-top: 1px solid var(--ligne); color: var(--gris); font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 20px;
}
.pied a { color: var(--gris); }

main { max-width: var(--largeur); margin: 0 auto; padding: 8px 16px 0; }

/* ----- accueil ----- */
.accueil { padding: 28px 0 8px; max-width: 720px; }
.accueil h1 { margin-bottom: 12px; }
.accroche { font-size: 19px; line-height: 1.45; color: #34332E; margin-bottom: 24px; }
.depot {
  display: block; width: 100%;
  border: 2px dashed var(--ligne); border-radius: var(--rayon); background: var(--surface);
  padding: 36px 20px; text-align: center; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.depot:hover, .depot.survol { border-color: var(--accent); background: var(--accent-pale); }
.depot:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.depot-titre { font-size: 18px; font-weight: 700; display: block; margin-bottom: 4px; }
.depot-aide { color: var(--gris); font-size: 15px; display: block; margin-bottom: 18px; }
.depot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.bouton {
  display: inline-block; min-height: 44px; padding: 10px 18px; border-radius: var(--rayon);
  border: 1px solid var(--encre); background: var(--encre); color: #fff; font-weight: 600; font-size: 16px;
  cursor: pointer; text-decoration: none; line-height: 1.3;
}
.bouton:hover { background: #000; color: #fff; }
.bouton.accent { background: var(--accent); border-color: var(--accent); }
.bouton.accent:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.bouton.clair { background: var(--surface); color: var(--encre); border-color: var(--ligne); }
.bouton.clair:hover { border-color: var(--encre); }
.bouton[disabled] { opacity: .45; cursor: default; }
.lien { background: none; border: 0; padding: 0; color: var(--accent-fonce); text-decoration: underline; cursor: pointer; font-size: inherit; min-height: 32px; }
.note { color: var(--gris); font-size: 15px; margin-top: 16px; }
.erreur-depot { margin-top: 14px; padding: 10px 12px; border-left: 4px solid var(--alerte); background: #FCEDEB; color: #6E1810; }

/* ----- résultat ----- */
.fichier-bandeau { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 6px 0 14px; color: var(--gris); font-size: 14px; }
.fichier-bandeau strong { color: var(--encre); font-weight: 600; word-break: break-all; }
.avertissements { margin: 0 0 14px; padding: 0; list-style: none; }
.avertissements li { padding: 8px 12px; margin-bottom: 6px; border-left: 4px solid var(--accent); background: var(--accent-pale); font-size: 15px; }

.synthese { border-top: 3px solid var(--encre); padding-top: 14px; }
.index-ligne { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.etiquette { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); }
.index-chiffre { font-size: clamp(64px, 18vw, 104px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.index-marge { font-size: clamp(22px, 6vw, 32px); font-weight: 600; color: var(--gris); }
.index-sous { font-size: 17px; margin-top: 6px; }
.index-sous .k { font-weight: 700; }
.attente { margin-top: 14px; }
.attente p { color: var(--gris); margin-bottom: 8px; }
.barre-attente { height: 3px; background: var(--gris-clair); position: relative; overflow: hidden; }
.barre-attente::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--accent); animation: glisse 1.3s ease-in-out infinite; }
@keyframes glisse { 0% { left: -30%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .barre-attente::after { animation: none; width: 100%; opacity: .5; } }
.erreur-calcul { margin-top: 12px; padding: 10px 12px; border-left: 4px solid var(--alerte); background: #FCEDEB; color: #5E150E; }

.depart-form { margin-top: 14px; padding: 14px; border: 1px solid var(--ligne); background: var(--surface); border-radius: var(--rayon); }
.depart-form p { margin-bottom: 10px; }
.champs { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.champ { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--gris); }
.champ input { min-height: 44px; padding: 8px 10px; border: 1px solid var(--ligne); border-radius: var(--rayon); background: #fff; color: var(--encre); font-size: 16px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; margin-top: 18px; border-top: 1px solid var(--ligne); }
.kpi { padding: 10px 0; border-bottom: 1px solid var(--ligne); min-width: 0; }
.kpi dt { font-size: 13px; color: var(--gris); }
.kpi dd { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.25; }
.kpi dd small { font-size: 14px; font-weight: 500; color: var(--gris); margin-left: 3px; }
@media (min-width: 720px) { .kpis { grid-template-columns: repeat(4, 1fr); } }

.explication { margin-top: 14px; font-size: 15px; }
.explication summary { cursor: pointer; color: var(--accent-fonce); min-height: 32px; }
.explication p { margin-top: 8px; max-width: 640px; }

section.bloc { margin-top: 36px; }
section.bloc > h2 { padding-bottom: 8px; border-bottom: 1px solid var(--ligne); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
section.bloc > h2 .aide { font-size: 14px; font-weight: 400; color: var(--gris); }

/* ----- carte ----- */
#carte { height: 440px; border: 1px solid var(--ligne); border-radius: var(--rayon); background: #E9E7E1; z-index: 0; }
@media (max-width: 600px) { #carte { height: 340px; } }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 14px; color: #34332E; align-items: center; }
.legende .titre { color: var(--gris); }
.pastille { display: inline-block; width: 22px; height: 6px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.repere {
  display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; color: #fff; font-weight: 700; font-size: 13px; line-height: 1;
}
.repere-depart { background: #2B8A3E; }
.repere-arrivee { background: var(--encre); }
.repere-dur { background: var(--accent); }
.leaflet-popup-content { font-family: inherit; font-size: 14px; line-height: 1.4; margin: 10px 14px; }
.popup-titre { font-weight: 700; margin-bottom: 2px; }

/* ----- graphique ----- */
.lecture { display: flex; flex-wrap: wrap; gap: 4px 18px; min-height: 26px; font-size: 15px; margin-bottom: 6px; }
.lecture span { white-space: nowrap; }
.lecture .conseil { white-space: normal; color: var(--gris); }
.lecture b { font-weight: 700; }
.graphique { height: 300px; position: relative; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
@media (max-width: 600px) { .graphique { height: 280px; } .lecture { min-height: 52px; } }
.graphique-canvas { display: block; touch-action: pan-y; cursor: crosshair; }
.indice-graphique { min-height: 22px; font-size: 14px; color: var(--gris); margin-top: 6px; }

/* ----- passages durs ----- */
.passages { list-style: none; margin: 0; padding: 0; }
.passages li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.passages li:hover { background: #F1EFE9; }
.num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.passages .t { font-weight: 600; }
.passages .d { color: #4A4943; font-size: 15px; }

/* ----- portions ----- */
.bascule { display: inline-flex; border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; margin-bottom: 12px; }
.bascule button { background: var(--surface); border: 0; padding: 9px 14px; min-height: 40px; cursor: pointer; color: var(--encre); font-size: 15px; }
.bascule button + button { border-left: 1px solid var(--ligne); }
.bascule button[aria-pressed=true] { background: var(--encre); color: #fff; }
table.portions { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; }
table.portions th { text-align: right; font-weight: 600; font-size: 12.5px; color: var(--gris); padding: 6px 4px; border-bottom: 1px solid var(--encre); }
table.portions th:first-child, table.portions td:first-child { text-align: left; width: 27%; }
table.portions td { text-align: right; padding: 9px 4px; border-bottom: 1px solid var(--ligne); }
table.portions tr.ligne { cursor: pointer; }
table.portions tr.ligne:hover { background: #F1EFE9; }
table.portions tr.choisie { background: var(--accent-pale); }
table.portions tr.choisie td:first-child { box-shadow: inset 4px 0 0 var(--accent); padding-left: 8px; }
table.portions .sens { display: block; font-size: 12px; color: var(--gris); }
table.portions td.fort { font-weight: 700; }
.note-table { font-size: 13.5px; color: var(--gris); margin-top: 8px; }
.defilement { overflow-x: auto; max-height: 520px; overflow-y: auto; }
@media (max-width: 480px) { table.portions { font-size: 14px; } table.portions th { font-size: 11.5px; } }

.detail-portion { margin-top: 16px; padding: 14px; border: 1px solid var(--encre); border-radius: var(--rayon); background: var(--surface); }
.detail-portion h3 { margin-bottom: 8px; }
.detail-portion .kpis { margin-top: 8px; }
.detail-portion .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.detail-portion .resultat-portion { margin-top: 12px; padding: 10px 12px; background: var(--accent-pale); border-left: 4px solid var(--accent); font-size: 16px; }
.detail-portion .resultat-portion.attente-p { background: #F1EFE9; border-color: var(--ligne); color: var(--gris); }

/* ----- simulateur ----- */
.sim-grille { display: grid; grid-template-columns: 1fr; gap: 14px 28px; }
@media (min-width: 720px) { .sim-grille { grid-template-columns: 1fr 1fr; } }
.reglage label, .reglage .lib { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; margin-bottom: 2px; }
.reglage output { font-weight: 700; }
.reglage input[type=range] { width: 100%; min-height: 32px; accent-color: var(--accent); margin: 0; }
.reglage input[type=date] { min-height: 44px; padding: 8px 10px; border: 1px solid var(--ligne); border-radius: var(--rayon); background: #fff; color: var(--encre); width: 100%; }
.sim-resultat { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--ligne); background: var(--surface); border-radius: var(--rayon); display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; }
.sim-resultat .gros { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.sim-resultat .ecart { font-weight: 700; color: var(--accent-fonce); }
.sim-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.effets { margin-top: 22px; }
.effets h3 { margin-bottom: 10px; }
.effet { display: grid; grid-template-columns: minmax(96px, 36%) 1fr 48px; gap: 8px; align-items: center; padding: 5px 0; font-size: 15px; }
.effet .zone { position: relative; height: 16px; }
.effet .zone::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--encre); }
.effet .barre { position: absolute; top: 2px; height: 12px; background: var(--accent); }
.effet .barre.neg { background: #8A8F96; }
.effet .val { text-align: right; font-weight: 700; }

/* ----- partage ----- */
.partage-grille { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .partage-grille { grid-template-columns: 340px 1fr; align-items: start; } }
.apercu { width: 100%; max-width: 340px; border: 1px solid var(--ligne); display: block; aspect-ratio: 1 / 1; background: var(--surface); }
.partage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.texte-partage { width: 100%; min-height: 84px; padding: 10px; border: 1px solid var(--ligne); border-radius: var(--rayon); background: #fff; resize: vertical; color: var(--encre); font-size: 16px; }
.confirmation { font-size: 14px; color: var(--gris); min-height: 20px; margin-top: 6px; }

/* ----- pages de texte ----- */
.texte { max-width: 720px; padding: 24px 0 0; }
.texte h1 { margin-bottom: 16px; }
.texte h2 { margin: 32px 0 8px; font-size: 20px; }
.texte h3 { margin: 20px 0 6px; }
.texte ul { padding-left: 20px; margin: 0 0 12px; }
.texte li { margin-bottom: 6px; }
.texte table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0 16px; }
.texte th, .texte td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--ligne); }
.texte th { border-bottom: 1px solid var(--encre); font-size: 13.5px; color: var(--gris); }
.texte .mise-a-jour { color: var(--gris); font-size: 14px; }
