/* Styles pour la réduction de polynômes et termes semblables (p1_l2_t3) */
.rrd-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

/* 1. Carte Définition */
.rrd-def-card {
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
}

.rrd-def-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rrd-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #0d9488;
  color: #ffffff;
}

.rrd-badge-icon svg {
  width: 17px;
  height: 17px;
}

.rrd-def-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f766e;
}

.rrd-def-text {
  font-size: 15.5px;
  color: #1e293b;
  margin: 6px 0 12px;
  line-height: 1.6;
}

.rrd-def-example {
  background: #ffffff;
  border: 1px solid #ccfbf1;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15.5px;
  color: #334155;
}

.rrd-formula-inline {
  font-family: 'Inter', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  padding: 0 4px;
}

.rrd-tag-term {
  padding: 2px 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  margin: 0 2px;
}

/* Couleurs des termes */
.rrd-c-blue {
  color: #0284c7;
}

.rrd-c-teal {
  color: #0d9488;
}

/* 2. Exemple pas à pas */
.rrd-example-container {
  border: 1.5px solid #fed7aa;
  background: #fffdfa;
  border-radius: 18px;
  padding: 22px;
  position: relative;
}

.rrd-example-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ea580c;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.15);
}

.rrd-intro-goal {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 22px;
}

.rrd-poly-target {
  font-family: 'Inter', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  padding-left: 6px;
}

/* Lignes d'étapes */
.rrd-step-row {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed #fed7aa;
}

.rrd-step-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.rrd-step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
}

.rrd-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f97316;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.rrd-step-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rrd-box {
  border-radius: 12px;
  padding: 12px 20px;
  min-width: 240px;
  max-width: 320px;
  flex: 1;
  text-align: center;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.rrd-box-pink {
  border: 1.5px solid #f472b6;
  background: #ffffff;
}

.rrd-expr {
  font-size: 18px;
  font-weight: 600;
  font-family: 'Inter', Georgia, serif;
  letter-spacing: 0.5px;
  color: #334155;
}

.rrd-arrows-svg {
  width: 100%;
  max-width: 220px;
  height: 28px;
  display: block;
  margin: 6px auto 0;
  overflow: visible;
}

.rrd-equal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #94a3b8;
  color: #ffffff;
  flex-shrink: 0;
}

.rrd-box-result {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

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

.rrd-final-val {
  font-size: 23px;
}

@media (max-width: 640px) {
  .rrd-step-flow {
    flex-direction: column;
    gap: 10px;
  }
  .rrd-box {
    width: 100%;
    min-width: 0;
  }
}
