/* Styles pour la multiplication de deux binômes (p1_l2_t8) */
.rbb-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.rbb-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 24px;
}

.rbb-card:last-child {
  margin-bottom: 0;
}

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

.rbb-num-badge {
  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;
}

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

/* 1) Liste étapes horizontales */
.rbb-steps-numbered {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
  color: #334155;
}

.rbb-steps-numbered li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rbb-step-circ {
  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;
  margin-top: 2px;
}

.rbb-example-frame {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px 24px;
  position: relative;
}

.rbb-ex-tag {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.rbb-calc-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 17px;
  color: #0284c7;
}

.rbb-flow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rbb-flow-expr {
  color: #0f172a;
  min-width: 140px;
}

.rbb-flow-spacer {
  min-width: 140px;
}

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

.rbb-flow-val {
  flex: 1;
}

.rbb-step-ref {
  color: #64748b;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  margin-left: auto;
}

/* 2) Schéma vertical */
.rbb-vert-expl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
}

.rbb-vert-calc-box {
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.rbb-vert-grid {
  display: grid;
  grid-template-columns: 24px 60px 24px 50px;
  align-items: center;
  justify-content: center;
  row-gap: 8px;
  font-size: 19px;
}

.rbb-vg-sign {
  text-align: center;
}

.rbb-mult-symbol {
  color: #0f172a;
  font-size: 20px;
  font-weight: bold;
}

.rbb-plus-symbol {
  color: #ea580c;
  font-size: 20px;
  font-weight: bold;
}

.rbb-vg-term {
  text-align: center;
}

.rbb-vg-op {
  text-align: center;
}

.rbb-vg-col-sq {
  text-align: center;
  grid-column: 1 / 3;
}

.rbb-vg-line {
  grid-column: 1 / -1;
  height: 2px;
  background: #64748b;
  margin: 4px 0;
}

/* Couleurs des lignes verticales */
.rbb-c-blue { color: #0284c7; }
.rbb-c-green { color: #16a34a; }
.rbb-c-pink { color: #db2777; }

.rbb-vert-steps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rbb-vert-step {
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14.5px;
  line-height: 1.5;
}

.rbb-vs-blue {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  color: #0369a1;
}

.rbb-vs-green {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #15803d;
}

.rbb-vs-pink {
  background: #fdf2f8;
  border: 1.5px solid #fbcfe8;
  color: #9d174d;
}

.rbb-vs-purple {
  background: #faf5ff;
  border: 1.5px solid #e9d5ff;
  color: #6b21a8;
}

/* 3) Tableau comparatif */
.rbb-table-wrapper {
  overflow-x: auto;
  border-radius: 14px;
  border: 1.5px solid #fed7aa;
}

.rbb-comp-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.rbb-comp-table th {
  background: #fed7aa;
  color: #9a3412;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
}

.rbb-comp-table td {
  padding: 20px;
  vertical-align: top;
  width: 50%;
  font-size: 16.5px;
  color: #0284c7;
}

.rbb-td-horiz {
  border-right: 1.5px dashed #fed7aa;
}

.rbb-tbl-expr {
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 8px;
}

.rbb-tbl-step {
  margin-bottom: 6px;
}

.rbb-tbl-res {
  margin-top: 10px;
  color: #0369a1;
  font-size: 18px;
}

.rbb-vert-table-calc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rbb-vtc-row {
  display: flex;
  gap: 12px;
  width: 160px;
  justify-content: flex-end;
}

.rbb-vtc-op {
  font-weight: bold;
  color: #ea580c;
  margin-right: auto;
}

.rbb-vtc-sep {
  width: 170px;
  height: 2px;
  background: #0284c7;
  margin: 4px 0;
}

.rbb-vtc-res {
  width: 170px;
  text-align: right;
  font-size: 17px;
  color: #0369a1;
}

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

@media (min-width: 768px) {
  .rbb-vert-expl-grid {
    grid-template-columns: 280px 1fr;
  }
}
