/* GoMathy V28 — Exercices harmonisés avec les feuilles de cours.
   Même logique visuelle : fond doux, parties pastel, cartes blanches lisibles,
   hiérarchie Partie > exercice > énoncé > aides/correction. */

.gm27-exercise-page{
  max-width:1120px!important;
  margin:18px auto 64px!important;
  padding:30px 32px 46px!important;
  border:1px solid #dfe6eb!important;
  border-radius:24px!important;
  background:#fbfaf6!important;
  box-shadow:0 12px 34px rgba(15,23,42,.055)!important;
}

/* En-tête dans la même famille que les cours/fiches : doux et cadré. */
.gm27-exercise-head{
  margin:0 0 24px!important;
  padding:22px 24px 24px!important;
  border:1px solid #d9e5f3!important;
  border-radius:18px!important;
  background:linear-gradient(135deg,#f4f8ff 0%,#f8fbff 58%,#f4fbf7 100%)!important;
}
.gm27-exercise-head .gm19-exercise-head__title h2{
  color:#10213a!important;
  font-size:clamp(2rem,3.7vw,2.65rem)!important;
}
.gm27-exercise-head .gm19-exercise-head__title p{color:#4d6a8a!important}

.gm27-stage-list{gap:18px!important}

/* Chaque niveau devient une vraie "partie" pastel, comme dans les feuilles. */
.gm27-stage{
  --gm28-bg:#effaf4;
  --gm28-border:#bfe8d1;
  --gm28-accent:#59bd8c;
  --gm28-ink:#176447;
  position:relative!important;
  margin:0!important;
  padding:18px!important;
  border:1px solid var(--gm28-border)!important;
  border-radius:18px!important;
  background:var(--gm28-bg)!important;
  box-shadow:none!important;
}
.gm19-stage--application.gm27-stage{
  --gm28-bg:#eef5ff;
  --gm28-border:#c5d9fb;
  --gm28-accent:#6b9cf3;
  --gm28-ink:#245b8c;
}
.gm19-stage--raisonnement.gm27-stage{
  --gm28-bg:#f5f1ff;
  --gm28-border:#d8c9f5;
  --gm28-accent:#9b7ad8;
  --gm28-ink:#5a4a85;
}
.gm19-stage--defi.gm27-stage{
  --gm28-bg:#fff7eb;
  --gm28-border:#f1d2a6;
  --gm28-accent:#e7a84f;
  --gm28-ink:#82531d;
}
.gm19-stage--bilan.gm27-stage{
  --gm28-bg:#fffbea;
  --gm28-border:#eadf9f;
  --gm28-accent:#cfb64c;
  --gm28-ink:#75620e;
}

.gm27-stage__head,
.gm19-stage--essentiel .gm27-stage__head,
.gm19-stage--application .gm27-stage__head,
.gm19-stage--raisonnement .gm27-stage__head,
.gm19-stage--defi .gm27-stage__head,
.gm19-stage--bilan .gm27-stage__head{
  margin:0 0 14px!important;
  padding:0 2px 12px!important;
  border-bottom:1px solid color-mix(in srgb,var(--gm28-border) 80%,#ffffff)!important;
  background:transparent!important;
}
.gm27-stage__head .gm19-stage__identity{
  align-items:flex-start!important;
  gap:10px!important;
}
.gm27-stage__head .gm19-stage__icon{
  width:32px!important;
  height:32px!important;
  flex-basis:32px!important;
  border:1px solid color-mix(in srgb,var(--gm28-border) 75%,#fff)!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:0 2px 7px rgba(15,23,42,.035)!important;
}
/* Réafficher le petit repère de partie et la phrase-guide : même grammaire que les cours. */
.gm27-stage__head .gm19-stage__identity>div>p{
  display:block!important;
  margin:0 0 2px!important;
  color:var(--gm28-ink)!important;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  font-size:.64rem!important;
  font-weight:850!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
}
.gm27-stage__head .gm19-stage__identity h3{
  margin:0!important;
  color:#132941!important;
  font-family:Georgia,"Times New Roman",serif!important;
  font-size:1.14rem!important;
  font-weight:750!important;
}
.gm27-stage__head .gm19-stage__identity>div>div{
  display:block!important;
  margin-top:3px!important;
  max-width:760px!important;
  color:#66798d!important;
  font-size:.76rem!important;
  line-height:1.4!important;
}
.gm27-stage__head .gm19-stage__stats{display:none!important}

.gm27-stage__list{gap:10px!important}

/* Exercice = carte blanche simple, nette, sans effet "tableau de bord". */
.gm27-exercise{
  border:1px solid color-mix(in srgb,var(--gm28-border) 64%,#dfe6ec)!important;
  border-radius:13px!important;
  background:#fff!important;
  box-shadow:0 2px 8px rgba(15,23,42,.025)!important;
}
.gm27-exercise__head{
  gap:10px!important;
  padding:12px 16px 10px!important;
  border-bottom:1px solid #edf1f4!important;
  background:color-mix(in srgb,var(--gm28-bg) 48%,#fff)!important;
}
.gm27-exercise__number,
.gm19-stage--application .gm27-exercise__number,
.gm19-stage--raisonnement .gm27-exercise__number,
.gm19-stage--defi .gm27-exercise__number,
.gm19-stage--bilan .gm27-exercise__number{
  padding:4px 8px!important;
  border:1px solid var(--gm28-border)!important;
  border-radius:7px!important;
  background:#fff!important;
  color:var(--gm28-ink)!important;
  font-size:.72rem!important;
}
.gm27-exercise__head h4{
  color:#24364d!important;
  font-size:.88rem!important;
  font-weight:760!important;
}
.gm27-exercise__body{
  padding:17px 18px 15px!important;
  color:#17263b!important;
  font-family:Georgia,"Times New Roman",serif!important;
  font-size:1rem!important;
  line-height:1.64!important;
}
.gm27-exercise__parts{gap:10px!important}
.gm27-exercise__parts>li{grid-template-columns:24px minmax(0,1fr)!important;gap:9px!important}
.gm27-exercise__parts>li::before{
  color:var(--gm28-ink)!important;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  font-size:.85rem!important;
  line-height:1.9!important;
}

/* Actions sobres, aux couleurs de la feuille. */
.gm27-exercise__actions{
  gap:7px!important;
  padding:0 18px 16px!important;
}
.gm27-help>summary,
.gm27-correction>summary{
  min-height:30px!important;
  padding:5px 9px!important;
  border-radius:7px!important;
  font-size:.74rem!important;
}
.gm27-help>summary{
  border:1px solid #dfe6ed!important;
  background:#fafcfd!important;
  color:#60758d!important;
}
.gm27-correction>summary{
  border:1px solid var(--gm28-border)!important;
  background:color-mix(in srgb,var(--gm28-bg) 65%,#fff)!important;
  color:var(--gm28-ink)!important;
}
.gm27-correction>summary:hover{background:var(--gm28-bg)!important}
.gm27-help__body,
.gm27-correction__body{
  border-radius:9px!important;
  box-shadow:none!important;
}
.gm27-correction__body{
  border-color:var(--gm28-border)!important;
  background:color-mix(in srgb,var(--gm28-bg) 42%,#fff)!important;
}

@media(max-width:760px){
  .gm27-exercise-page{
    margin:7px auto 34px!important;
    padding:18px 10px 30px!important;
    border-radius:16px!important;
  }
  .gm27-exercise-head{padding:18px 15px 19px!important;border-radius:14px!important}
  .gm27-stage{padding:12px!important;border-radius:14px!important}
  .gm27-stage__head{padding-bottom:10px!important}
  .gm27-stage__head .gm19-stage__identity>div>div{font-size:.72rem!important}
  .gm27-exercise__head{padding:11px 13px 9px!important}
  .gm27-exercise__body{padding:15px 14px 13px!important;font-size:.96rem!important}
  .gm27-exercise__actions{padding:0 14px 14px!important}
}
