/* Styles pour la division de deux monômes (p1_l2_t10) */
.rmd-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.rmd-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 14px;
}

.rmd-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
}

.rmd-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.rmd-badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #ea580c;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.rmd-card-title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: #0f172a;
}

.rmd-hl-red {
  color: #dc2626;
}

.rmd-c-red {
  color: #dc2626;
}

.rmd-intro {
  font-size: 15px;
  color: #475569;
  margin: 4px 0 16px 38px;
}

/* 1. Exemple 1 : Liste des 4 étapes */
.rmd-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-left: 10px;
}

.rmd-step-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 18px;
}

.rmd-step-desc {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  color: #1e293b;
  margin-bottom: 8px;
  font-weight: 600;
}

.rmd-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f59e0b;
  color: #ffffff;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.rmd-calc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 30px;
  font-size: 17px;
  color: #0284c7;
  flex-wrap: wrap;
}

.rmd-orig-op {
  color: #0f172a;
  min-width: 130px;
}

.rmd-eq {
  color: #64748b;
  font-weight: bold;
}

/* 2. Exemple 2 : Alignement vertical */
.rmd-flow-numbered {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 17.5px;
  color: #0284c7;
}

.rmd-flow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.rmd-flow-left {
  min-width: 170px;
  color: #0f172a;
}

/* Barrement rouge des facteurs simplifiés */
.rmd-cross {
  position: relative;
  display: inline-block;
  color: #0369a1;
}

.rmd-cross::after {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: calc(100% + 4px);
  height: 2px;
  background-color: #ef4444;
  transform: rotate(-45deg);
  transform-origin: center;
}

/* Fractions */
.rmd-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  padding: 0 4px;
  font-size: 0.95em;
  line-height: 1.15;
}

.rmd-num {
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 3px;
}

.rmd-den {
  padding-top: 3px;
}

.rmd-ans-pill {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #0284c7;
  border-radius: 8px;
  padding: 3px 14px;
  font-size: 18px;
}

.font-hand {
  font-family: 'Segoe Print', 'Comic Sans MS', cursive, sans-serif;
}

.font-sans {
  font-family: system-ui, -apple-system, sans-serif;
}

@media (max-width: 640px) {
  .rmd-calc-row {
    padding-left: 0;
  }
  .rmd-intro {
    margin-left: 0;
  }
  .rmd-flow-left {
    min-width: 0;
    width: 100%;
  }
}
