.mci-widget {
  max-width: 960px;
  margin: 1.75rem auto;
  font-family: inherit;
}

/* ==================== SÉLECTEUR MATRICE 2x2 ==================== */
.mci-matrix-wrapper {
  margin-bottom: 1.5rem;
}

.mci-matrix-axis-top {
  margin-left: 115px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  margin-bottom: 0.4rem;
}

.mci-col-headers {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.mci-col-header {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.mci-col-header.conf-yes {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.mci-matrix-row {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}

.mci-row-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  line-height: 1.25;
  letter-spacing: 0.03em;
  box-sizing: border-box;
}

.mci-row-header.int-yes {
  background: #faf5ff;
  border-color: #d8b4fe;
  color: #7c3aed;
}

.mci-row-header-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 900;
  margin-top: 4px;
  background: #e2e8f0;
  color: #0f172a;
}

.mci-row-header.int-yes .mci-row-header-badge {
  background: #f3e8ff;
  color: #6b21a8;
}

.mci-quadrant-btn {
  text-align: left;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 95px;
  box-sizing: border-box;
}

.mci-quadrant-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.mci-btn-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
  width: fit-content;
}

.mci-btn-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.mci-btn-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.mci-btn-metric {
  font-size: 0.76rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}

/* Thèmes par quadrant */
.mci-q-neither {
  border-color: #86efac;
}
.mci-q-neither .mci-btn-badge {
  background: #dcfce7;
  color: #15803d;
}
.mci-q-neither.active {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 2px #16a34a, 0 6px 14px rgba(22, 163, 74, 0.15);
}

.mci-q-confusion {
  border-color: #fde68a;
}
.mci-q-confusion .mci-btn-badge {
  background: #fef3c7;
  color: #b45309;
}
.mci-q-confusion.active {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: 0 0 0 2px #d97706, 0 6px 14px rgba(217, 119, 6, 0.15);
}

.mci-q-interaction {
  border-color: #d8b4fe;
}
.mci-q-interaction .mci-btn-badge {
  background: #f3e8ff;
  color: #7e22ce;
}
.mci-q-interaction.active {
  border-color: #9333ea;
  background: #faf5ff;
  box-shadow: 0 0 0 2px #9333ea, 0 6px 14px rgba(147, 51, 234, 0.15);
}

.mci-q-both {
  border-color: #fecdd3;
}
.mci-q-both .mci-btn-badge {
  background: #ffe4e6;
  color: #be123c;
}
.mci-q-both.active {
  border-color: #e11d48;
  background: #fff1f2;
  box-shadow: 0 0 0 2px #e11d48, 0 6px 14px rgba(225, 29, 72, 0.15);
}

/* ==================== CARTE DU FOREST PLOT ==================== */
.mci-forest-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mci-forest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.mci-forest-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.mci-forest-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.mci-forest-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
}

.mci-forest-badge {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================== BANDEAU TABLE 1 (2 LIGNES ÉPURÉES) ==================== */
.mci-table1-strip {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0284c7;
  border-radius: 7px;
  padding: 8px 12px;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: #334155;
  box-sizing: border-box;
}

.mci-t1-row-data {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mci-t1-left {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.mci-t1-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.mci-t1-var {
  font-weight: 700;
  color: #0f172a;
}

.mci-t1-arms {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.8rem;
}

.mci-t1-arm-ctrl,
.mci-t1-arm-treat {
  font-weight: 600;
  color: #1e293b;
}

.mci-t1-vs {
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 500;
}

.mci-t1-row-status {
  display: flex;
  align-items: center;
}

.mci-t1-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  .mci-t1-row-data {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .mci-t1-arms {
    justify-content: center;
  }
}

.mci-svg-container {
  width: 100%;
  overflow-x: auto;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mci-svg {
  width: 100%;
  max-width: 760px;
  height: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mci-forest-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.mci-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mci-legend-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.mci-legend-diamond {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  display: inline-block;
}

/* ==================== PANNEAU D'ANALYSE (MONOLOGUE & EDN) ==================== */
.mci-analysis-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Monologue intérieur (Think Aloud) */
.mci-monologue-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #3b82f6;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  transition: border-color 0.2s ease;
}

.mci-box-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #334155;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mci-monologue-quote {
  font-size: 0.94rem;
  line-height: 1.55;
  color: #1e293b;
  font-style: italic;
  margin: 0;
}

.mci-monologue-quote strong {
  font-style: normal;
  color: #0f172a;
}

/* Décodage d'examen en 2 temps */
.mci-exam-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mci-steps-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.mci-step {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}

.mci-step-num {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.mci-step-content {
  font-size: 0.88rem;
  line-height: 1.4;
  color: #334155;
}

.mci-res-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 4px 0;
}

.mci-tag-green {
  background: #dcfce7;
  color: #15803d;
}
.mci-tag-amber {
  background: #fef3c7;
  color: #b45309;
}
.mci-tag-purple {
  background: #f3e8ff;
  color: #7e22ce;
}
.mci-tag-rose {
  background: #ffe4e6;
  color: #be123c;
}

.mci-decision-row, .mci-trap-row {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
  margin-top: 0.6rem;
}

.mci-decision-row {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.mci-trap-row {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 720px) {
  .mci-matrix-axis-top {
    margin-left: 0;
  }
  .mci-col-headers {
    display: none;
  }
  .mci-matrix-row {
    grid-template-columns: 1fr;
  }
  .mci-row-header {
    display: none;
  }
  .mci-steps-grid {
    grid-template-columns: 1fr;
  }
  .mci-forest-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
