/* Salle112 • modèle unifié des chapitres 6e / 5e / 4e / 3e
   Surcharge visuelle uniquement. Les moteurs d'exercices et les événements de suivi restent inchangés.
   La 5e dispose déjà de sa feuille pilote validée. */
.s112-chapter{
  --s112-ink:#173b69;
  --s112-muted:#566d7d;
  --s112-accent:#28649f;
  --s112-deep:#184d80;
  --s112-pale:#eaf3ff;
  --s112-border:#bfd8ef;
  background:radial-gradient(ellipse 32rem 24rem at 3% 7%,var(--s112-pale) 0%,transparent 75%),
             radial-gradient(ellipse 27rem 24rem at 99% 8%,#edf5ff 0%,transparent 80%),#fff !important;
  color:var(--s112-ink);
}
.s112-chapter.s112-level-5e{--s112-accent:#2d8753;--s112-deep:#1f7045;--s112-pale:#e9f7ed;--s112-border:#b9ddc7}
.s112-chapter.s112-level-4e{--s112-accent:#ac7414;--s112-deep:#855711;--s112-pale:#fff2d7;--s112-border:#ecd5a0}
.s112-chapter.s112-level-3e{--s112-accent:#7954a9;--s112-deep:#64438e;--s112-pale:#f1eafd;--s112-border:#d8c4f0}
.s112-chapter .training-topbar{
  background:rgba(255,255,255,.96);border-bottom:1px solid #e4edf0;
  backdrop-filter:blur(10px)
}
.s112-chapter .training-brand strong{color:#27814c}
.s112-chapter .training-shell{width:min(1080px,calc(100% - 36px));padding:24px 0 52px}
.s112-chapter .training-breadcrumb{margin-bottom:15px;font-size:.88rem;gap:.45rem}
.s112-chapter .training-breadcrumb a{color:var(--s112-deep)}
.s112-chapter .s112-chapter-intro{
  padding:clamp(22px,3.5vw,36px);
  border:1px solid var(--s112-border);border-radius:25px;
  background:linear-gradient(118deg,var(--s112-pale) 0%,#fff 82%);
  box-shadow:0 8px 22px rgba(25,59,82,.05)
}
.s112-chapter .s112-chapter-kicker{
  margin:0 0 7px;color:var(--s112-deep);font-size:.79rem;font-weight:900;
  letter-spacing:.075em;text-transform:uppercase
}
.s112-chapter .s112-chapter-intro h1{
  margin:0 0 9px;color:var(--s112-ink);font-weight:900;
  font-size:clamp(2rem,4vw,3.4rem);line-height:1.08;letter-spacing:-.05em
}
.s112-chapter .s112-chapter-description{
  margin:0;max-width:67ch;color:var(--s112-muted);
  font-size:clamp(.94rem,1.45vw,1.02rem);line-height:1.55
}
/* Do not interfere with modules' handlers: leave the original data-* and id hooks intact. */
.s112-chapter .start-panel{margin-top:16px}
.s112-chapter .start-main{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;
  min-height:86px;width:100%;padding:14px 19px;
  color:#fff;text-align:left;border:0;border-radius:18px;
  background:linear-gradient(105deg,var(--s112-accent),var(--s112-deep));
  box-shadow:0 12px 22px rgba(29,65,79,.12);cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease
}
.s112-chapter .start-main:hover{transform:translateY(-2px);filter:none;box-shadow:0 16px 28px rgba(29,65,79,.19)}
.s112-chapter .start-main .start-icon{
  display:grid;place-items:center;width:48px;height:48px;
  border:0;border-radius:14px;background:rgba(255,255,255,.17);color:#fff;
  font-size:1.02rem
}
.s112-chapter .start-main strong{font-size:1.2rem;font-weight:900;line-height:1.2;color:#fff}
.s112-chapter .start-main small{font-size:.86rem;color:rgba(255,255,255,.9)}
.s112-chapter .start-main b{font-size:1.5rem;color:#fff}
.s112-chapter .targeted-wrap{margin-top:27px}
.s112-chapter .targeted-wrap h2{margin:0 0 14px;font-size:1.38rem;font-weight:900;letter-spacing:-.035em;color:var(--s112-ink)}
.s112-chapter .targeted-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.s112-chapter .targeted-grid button{
  display:flex;align-items:center;gap:12px;min-height:74px;
  padding:12px 14px;border:1px solid #dbe7e9;border-radius:16px;
  background:#fff;color:var(--s112-ink);box-shadow:0 4px 12px rgba(27,65,81,.045);
  font-family:inherit;font-size:.98rem;font-weight:800;text-align:left;line-height:1.35;
  cursor:pointer;transition:transform .15s ease,border-color .15s ease,background .15s ease
}
.s112-chapter .targeted-grid button:hover{transform:translateY(-2px);background:#fff;border-color:var(--s112-border)}
.s112-chapter .targeted-grid button > span:first-child{
  display:grid;flex:0 0 40px;place-items:center;
  width:40px;height:40px;min-width:40px;min-height:40px;
  margin:0;padding:0;border:0;border-radius:12px;
  color:var(--s112-deep);background:var(--s112-pale);font-size:1rem;font-weight:900
}
/* A few chapters use a second title span with its own inherited module styling. */
.s112-chapter .targeted-grid button > span.targeted-label{
  display:block;flex:1;min-width:0;width:auto;height:auto;min-height:0;
  padding:0;margin:0;border:0;background:transparent;border-radius:0;
  text-align:left;color:var(--s112-ink);font-size:.95rem;font-weight:800
}
.s112-chapter .targeted-grid button > span.targeted-label small{
  display:block;padding-top:3px;color:var(--s112-muted);font-weight:500
}
/* Supplemental content (brevet, notes pedag., Scratch) stays available after chapter list. */
.s112-chapter .brevet-launch-wrap{margin-top:23px}
.s112-chapter .scratch-course-note,
.s112-chapter .program-source-note{margin:13px 0 0;padding:12px 15px;border:1px solid var(--s112-border);border-radius:14px;background:#fff;color:var(--s112-muted);font-size:.87rem;line-height:1.5}
.s112-chapter .s112-exercise-chapter-label{
  margin:3px 0 12px;color:var(--s112-deep);
  font-size:.89rem;font-weight:620;line-height:1.4
}
.s112-chapter .s112-exercise-chapter-label strong{color:var(--s112-ink);font-weight:850}
.s112-chapter .exercise-card{border-top:4px solid var(--s112-accent);border-radius:23px}
.s112-chapter .exercise-view .exercise-topline{margin-bottom:12px}
.s112-chapter .training-home-link{background:#fff}
.s112-chapter button:focus-visible,.s112-chapter a:focus-visible{outline:3px solid #cc982e;outline-offset:3px}
@media(max-width:720px){
  .s112-chapter .targeted-grid{grid-template-columns:1fr}
}
@media(max-width:560px){
  .s112-chapter .training-shell{width:calc(100% - 24px);padding:14px 0 34px}
  .s112-chapter .training-breadcrumb{margin-bottom:12px;font-size:.8rem}
  .s112-chapter .s112-chapter-intro{padding:19px 18px;border-radius:21px}
  .s112-chapter .s112-chapter-intro h1{font-size:clamp(1.9rem,8vw,2.45rem)}
  .s112-chapter .s112-chapter-description{font-size:.91rem;line-height:1.48}
  .s112-chapter .start-panel{margin-top:13px}
  .s112-chapter .start-main{min-height:76px;padding:12px 13px;gap:11px;border-radius:16px}
  .s112-chapter .start-main .start-icon{width:42px;height:42px}
  .s112-chapter .start-main strong{font-size:1.07rem}
  .s112-chapter .start-main small{font-size:.8rem}
  .s112-chapter .targeted-wrap{margin-top:23px}
  .s112-chapter .targeted-wrap h2{font-size:1.23rem}
  .s112-chapter .targeted-grid{gap:9px}
  .s112-chapter .targeted-grid button{min-height:66px;padding:10px 12px;border-radius:15px;font-size:.93rem;gap:10px}
  .s112-chapter .targeted-grid button>span:first-child{min-width:37px;width:37px;min-height:37px;height:37px;flex-basis:37px}
  .s112-chapter .training-footer{padding-bottom:16px}
}
@media(prefers-reduced-motion:reduce){
  .s112-chapter .start-main,.s112-chapter .targeted-grid button{transition:none}
}
