/* Page « S'entraîner sur les graphes du bac » (complète style.css) */

.methode-4 { margin: 0 0 12px; padding-left: 22px; max-width: 760px; }
.methode-4 li { margin-bottom: 6px; }

.sommaire {
  display: grid; gap: 20px; margin-top: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--blanc); border: 2px solid var(--vert-clair);
  border-radius: var(--rayon); padding: 18px 20px;
}
.sommaire h3 { margin: 0 0 6px; color: var(--marine); font-size: 1.05rem; }
.sommaire ol { margin: 0; padding-left: 22px; }
.sommaire li { margin-bottom: 4px; }

.graphe {
  background: var(--blanc); border-radius: var(--rayon);
  border-top: 5px solid var(--bleu); box-shadow: 0 2px 8px rgba(23, 50, 77, 0.08);
  padding: 24px; margin-bottom: 32px; max-width: 820px;
  scroll-margin-top: 80px;
}
section.alt .graphe { border-top-color: var(--vert); }
.graphe-theme {
  margin: 0; color: var(--gris); font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: bold;
}
.graphe h3 { margin: 4px 0 10px; color: var(--marine); font-size: 1.25rem; }
.graphe h4 { margin: 20px 0 6px; color: var(--marine); font-size: 1.05rem; }
.contexte {
  margin: 0 0 16px; padding: 12px 14px; background: var(--bleu-clair);
  border-radius: 8px; font-size: 0.97rem;
}

.graphe figure { margin: 0; }
.graphe figcaption { font-weight: bold; color: var(--marine); margin-bottom: 8px; line-height: 1.4; }
.graphe-svg {
  display: block; width: 100%; max-width: 560px; height: auto;
  border: 1px solid #D6E2EC; border-radius: 8px;
}
.note { font-size: 0.85rem; color: var(--gris); margin: 6px 0 0; }

.consignes { margin: 0; padding-left: 24px; }
.consignes li { margin-bottom: 8px; }

@media (max-width: 640px) {
  .graphe { padding: 16px 12px; }
  .graphe-svg { border-radius: 4px; }
}

/* ---------- Schéma de la régulation de la glycémie, à compléter (schema_glycemie.js) ---------- */
.sommaire-schema { margin: 8px 0 0; font-weight: bold; }
.sg-figure { margin: 0; }
.sg-schema {
  max-width: 560px; padding: 14px 12px; border: 1px solid #D6E2EC; border-radius: 8px;
  background: var(--blanc); display: flex; flex-direction: column; align-items: stretch;
}
.sg-case { padding: 8px 10px; border-radius: 6px; background: var(--blanc); }
.sg-pointilles { border: 2px dashed var(--gris); }
.sg-plein { border: 2px solid var(--marine); }
.sg-sans-cadre { padding: 4px 0; flex: 1; min-width: 0; }
.sg-label { display: block; font-weight: bold; color: var(--marine); font-size: 0.95rem; margin-bottom: 4px; }
.sg-champ {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: 7px 8px;
  border: 1.5px solid var(--gris); border-radius: 6px; background: #fff; color: var(--texte); min-height: 40px;
}
.sg-champ:focus, .sg-signe:focus { outline: 3px solid var(--bleu); outline-offset: 2px; }
.sg-champ-juste { border-color: var(--vert); background: var(--vert-pale); }
.sg-champ-faux { border-color: var(--orange); background: var(--orange-clair); }
.sg-lien { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 8px; min-height: 52px; }
.sg-fleche { width: 24px; height: 48px; flex: none; }
.sg-eclair { width: 30px; }
.sg-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.sg-col { display: flex; flex-direction: column; min-width: 0; }
.sg-signe-boite { display: contents; }
.sg-signe {
  -webkit-appearance: none; appearance: none; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--marine); background: #fff; color: var(--marine);
  font: inherit; font-size: 1.3rem; font-weight: bold; text-align: center; text-align-last: center;
  padding: 0; cursor: pointer;
}
.sg-signe.sg-champ-juste { border-color: var(--vert); background: var(--vert-pale); }
.sg-signe.sg-champ-faux { border-color: var(--orange); background: var(--orange-clair); }
.sg-retour { margin: 4px 0 0; font-size: 0.85rem; line-height: 1.35; }
.sg-retour:empty { display: none; }
.sg-retour-signe { order: 3; flex: 0 0 100%; text-align: center; margin-bottom: 4px; }
.sg-phenomene .sg-retour-signe { text-align: left; }
.sg-juste { color: #2F6B1A; }
.sg-faux { color: #8A3F00; }
.sg-effecteur {
  margin-top: 4px; padding: 10px; border: 2px solid var(--marine); border-radius: 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.sg-phenomene { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 10px; }
.sg-phenomene .sg-signe { margin-top: 8px; }
.sg-reaction { display: grid; grid-template-columns: auto minmax(70px, 120px) auto; align-items: center; justify-content: center; gap: 8px; }
.sg-molecule { font-weight: bold; color: var(--marine); }
.sg-reaction-fleches { display: block; width: 100%; height: auto; }
.sg-legende { list-style: none; margin: 10px 0 0; padding: 0; font-size: 0.9rem; max-width: 560px; }
.sg-legende li { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.sg-puce { display: inline-block; width: 26px; height: 0; flex: none; border-top: 3px solid; }
.sg-puce-orange { border-color: #E97817; }
.sg-puce-bleue { border-color: #1E78B5; }
.sg-boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sg-bouton {
  font: inherit; font-weight: bold; padding: 10px 18px; min-height: 44px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--marine); background: var(--marine); color: #fff;
}
.sg-bouton.sg-secondaire { background: #fff; color: var(--marine); }
.sg-bouton:focus { outline: 3px solid var(--bleu); outline-offset: 2px; }
.sg-bilan { margin: 10px 0 0; font-weight: bold; color: var(--marine); }
.sg-cache {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 420px) {
  .sg-schema { padding: 10px 6px; }
  .sg-case { padding: 6px; }
  .sg-label { font-size: 0.88rem; }
  .sg-colonnes { gap: 6px; }
  .sg-reaction { gap: 4px; grid-template-columns: auto minmax(56px, 1fr) auto; }
  .sg-molecule { font-size: 0.9rem; }
}

/* Méthode guidée et autocorrection */
.phrases-modeles { list-style: none; padding: 0; margin: 0 0 12px; max-width: 800px; }
.phrases-modeles li { background: var(--blanc); border-left: 4px solid var(--vert-clair); padding: 8px 12px; margin-bottom: 8px; border-radius: 6px; }
.phrases-modeles b { color: var(--marine); }
.autocorrection { background: #f6fbf8; border: 2px solid var(--vert-clair); border-radius: var(--rayon); padding: 16px 18px; margin-top: 16px; max-width: 800px; }
.autocorrection h4 { margin-top: 0; }
.autocorrection p { line-height: 2.2; }
.autocorrection input, .autocorrection select { font: inherit; padding: 2px 6px; border: 1px solid #8a9aa8; border-radius: 4px; max-width: 100%; }
.autocorrection input.juste, .autocorrection select.juste { border-color: #1b7a43; background: #e6f5ec; }
.autocorrection input.faux, .autocorrection select.faux { border-color: #b3261e; background: #fdeceb; }
.mini-corr { font-size: .9rem; }
.bilan-auto { background: #fff; border: 2px solid var(--marine); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.autocorrection button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 2px solid var(--marine); background: var(--marine); color: #fff; cursor: pointer; margin-right: 8px; }
.autocorrection button.btn-recommencer { background: #fff; color: var(--marine); }
.graphe-verrou { background: #f3f5f7; border: 2px dashed #8a9aa8; border-radius: var(--rayon); padding: 14px 18px; }

/* ---------- Graphe à démarche pas à pas (id="glycosurie") ---------- */
.demarche-intro { margin: 0 0 12px; font-size: 0.95rem; }
.demarche { padding-left: 0; list-style: none; counter-reset: etape; }
.demarche > li.etape {
  counter-increment: etape; position: relative; margin: 0 0 16px; padding: 12px 14px 12px 54px;
  background: var(--blanc); border: 1px solid #D6E2EC; border-left: 5px solid var(--bleu); border-radius: 8px;
}
.demarche > li.etape::before {
  content: counter(etape); position: absolute; left: 12px; top: 12px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--marine); color: #fff; font-weight: bold; text-align: center; line-height: 30px;
}
.etape-titre { margin: 0 0 4px; font-weight: bold; color: var(--marine); font-size: 1.05rem; }
.etape-consigne { margin: 0 0 8px; }
.coup-de-pouce { margin: 8px 0; border: 1px dashed var(--gris); border-radius: 6px; padding: 0 10px; background: #FBFCFD; }
.coup-de-pouce summary { cursor: pointer; font-weight: bold; color: var(--marine); padding: 10px 0; min-height: 24px; }
.coup-de-pouce summary:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.coup-de-pouce p { margin: 0 0 10px; }
.demarche .cg-zone { margin: 10px 0 4px; }
.demarche .cg-label { display: block; font-weight: bold; font-size: 0.95rem; margin-bottom: 4px; color: var(--marine); }
.demarche .cg-texte {
  display: block; box-sizing: border-box; width: 100%; min-height: 96px; padding: 8px 10px; font: inherit; font-size: 1rem;
  line-height: 1.45; color: var(--texte); background: #fff; border: 2px solid var(--gris); border-radius: 8px; resize: vertical;
}
.demarche .cg-texte:focus { outline: 3px solid var(--bleu); outline-offset: 1px; }
.nephron { margin: 10px 0; }
.nephron figcaption { font-size: 0.95rem; }
.nephron-svg { max-width: 520px; }
@media (max-width: 640px) { .demarche .nephron { margin-left: -6px; margin-right: -6px; } }
.nephron-cle { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.9rem; }
.nephron-cle li { margin-bottom: 3px; }
.cle-trait { display: inline-block; width: 26px; height: 0; border-top: 3px solid; vertical-align: middle; margin-right: 6px; }
.cle-filtration { border-color: #B35300; }
.cle-reabsorption { border-color: #2F7D1F; }
.cle-flux { border-color: #17324D; }
@media (max-width: 640px) {
  .demarche > li.etape { padding: 48px 10px 10px; }
  .demarche > li.etape::before { left: 10px; top: 10px; }
}
.cle-autres { border-color: #8A97A3; }

/* ---------- Relevé de valeurs sur un graphe (releve_graphe.js) ---------- */
.releve { margin: 10px 0; padding: 10px 12px; border: 2px solid var(--vert-clair); border-radius: 8px; background: #F7FAFC; }
.releve-titre { margin: 0 0 6px; font-weight: bold; color: var(--marine); }
.releve-defile { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.releve-defile:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.releve table { border-collapse: collapse; font-size: 0.92rem; background: #fff; }
.releve th, .releve td { border: 1px solid #B8C6D3; padding: 4px; text-align: center; vertical-align: middle; white-space: nowrap; }
.releve thead th { background: #EAF1F8; color: var(--marine); }
.releve tbody th { text-align: left; white-space: normal; min-width: 92px; color: var(--marine); }
.releve-champ { width: 3.6em; box-sizing: border-box; font: inherit; padding: 6px 4px; min-height: 36px; text-align: center; border: 1.5px solid var(--gris); border-radius: 4px; }
.releve-champ:focus { outline: 3px solid var(--bleu); outline-offset: 1px; }
.releve-champ.releve-juste { border-color: #1b7a43; background: #e6f5ec; }
.releve-champ.releve-faux { border-color: #8A3F00; background: #fff4e5; }
.releve-marque { display: block; font-size: 0.8rem; line-height: 1.1; }
.releve-verifier, .releve-effacer { font: inherit; font-weight: bold; margin: 10px 8px 0 0; padding: 8px 14px; min-height: 44px; border-radius: 8px; border: 2px solid var(--marine); background: var(--marine); color: #fff; cursor: pointer; }
.releve-effacer { background: #fff; color: var(--marine); }
.releve-score { margin: 8px 0 4px; font-weight: bold; color: var(--marine); }
.releve-score:empty, .releve-indices:empty { display: none; }
.releve-indices { margin: 0; padding-left: 0; list-style: none; font-size: 0.9rem; color: #6b3a00; }
.releve-indices li { margin-bottom: 3px; }

/* Consigne de rédaction après le tableau de relevé */
.releve-redaction { margin: 1rem 0 .5rem; padding: .7rem .9rem; border-left: 4px solid #1E78B5; background: #EAF5FC; border-radius: 6px; line-height: 1.5; }

/* Regroupement des graphes par thème */
.groupe-theme { margin: 2.2rem 0 1rem; padding: 1rem 1rem .5rem; border: 2px solid #1E78B5; border-radius: 14px; background: rgba(234,245,252,.55); }
.titre-theme { margin: 0 0 1rem; padding: .5rem .8rem; background: #17324D; color: #fff; border-radius: 8px; font-size: 1.15rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.titre-theme .nb-graphes { font-size: .85rem; font-weight: normal; opacity: .85; }
@media (max-width: 640px) { .groupe-theme { padding: .6rem .4rem .2rem; } }
