/* ===== RECHERCHE IA — 3 modes, pipeline 3 étapes, filtre ROME ===== */

.si-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }

/* ── Barre de chargement ── */
.si-load-wrap { padding: 20px 0 12px; }
.si-load-track {
  height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden;
}
.si-load-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width 0.3s ease;
}
.si-load-text { font-size: 0.83rem; color: #64748b; margin-top: 10px; font-style: italic; }

/* ── Layout permanent 2 colonnes ── */
.si-body-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 12px;
}
.si-main-area { min-width: 0; }

/* ── Panneau certification source ── */
.si-source-card {
  border: 1px solid #BFE0D8; border-radius: 12px;
  background: #f8faff; padding: 14px 18px;
  margin-bottom: 14px;
}
.si-source-hd {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.si-source-hd-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.si-source-hd-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.si-source-title { font-size: 0.95rem; font-weight: 700; color: #1e3a8a; line-height: 1.3; }
.si-source-count { font-size: 0.75rem; font-weight: 700; color: #2563eb; background: #dbeafe; padding: 2px 9px; border-radius: 99px; }
.si-source-rome { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.si-source-reset {
  font-size: 0.75rem; font-weight: 600; color: #64748b;
  background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px;
  padding: 3px 10px; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.si-source-reset:hover { background: #e2e8f0; }

/* Blocs accordéon */
.si-src-blocs { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.si-src-bloc { border: 1px solid #bfdbfe; border-radius: 8px; overflow: hidden; background: #fff; }
.si-src-bloc-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer; transition: background .12s;
}
.si-src-bloc-hd:hover { background: #eff6ff; }
.si-src-bloc-num {
  /* Pas border-radius:50% + hauteur fixe : un vrai code de bloc officiel
     ("RNCP39421BC04", 13 caractères) y étire le badge en ellipse déformée
     au lieu du petit rond attendu pour un label court ("B01"). */
  min-width: 22px; padding: 3px 7px; border-radius: 6px;
  background: #2563eb; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; flex-shrink: 0; white-space: nowrap;
}
.si-src-bloc-title { font-size: 0.83rem; font-weight: 600; color: #1e3a8a; flex: 1; }
.si-src-bloc-arrow { color: #2563eb; font-size: 1rem; font-weight: 700; flex-shrink: 0; }
.si-src-bloc-body { padding: 10px 14px 12px 46px; border-top: 1px solid #bfdbfe; background: #f8faff; }

.si-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.si-head h1 { font-size: 24px; font-weight: 700; margin: 0; }
.si-sub { color: #64748b; font-size: 14px; line-height: 1.5; margin: 0 0 20px; }

/* ── Badge moteur IA ── */
.si-engine-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.si-engine-badge.active   { background: #dcfce7; color: #166534; }
.si-engine-badge.fallback { background: #f1f5f9; color: #64748b; }
.si-engine-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.si-engine-badge.active   .si-engine-dot { background: #22c55e; }
.si-engine-badge.fallback .si-engine-dot { background: #94a3b8; }

/* ── Grille 3 modes ── */
.si-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.si-mode-card {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 4px; padding: 14px 16px;
  border: 2px solid #e2e8f0; border-radius: 14px;
  background: #fff; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  text-align: left;
}
.si-mode-card:hover { border-color: var(--si-color, #2563eb); background: #fafbff; }
.si-mode-card.active {
  border-color: var(--si-color, #2563eb);
  background: color-mix(in srgb, var(--si-color, #2563eb) 6%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--si-color, #2563eb) 15%, transparent);
}
.si-mode-icon  { font-size: 22px; margin-bottom: 2px; }
.si-mode-label { font-size: 14px; font-weight: 700; color: #0f172a; }
.si-mode-desc  { font-size: 11px; font-weight: 600; color: var(--si-color, #2563eb); }
.si-mode-detail{ font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ── Filtre ROME + onglets RNCP/RS ── */
.si-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin-bottom: 12px; padding: 10px 14px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
}
.si-filter-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: #475569;
}
.si-filter-label select {
  font-size: 12px; padding: 5px 10px;
  border: 1px solid #cbd5e1; border-radius: 7px; background: #fff;
  color: #0f172a; cursor: pointer;
}

/* ── Badge expansion Mistral ── */
.si-badge-ai {
  font-size: 11px; font-weight: 700; color: #2563eb;
  background: #dbeafe; border-radius: 6px; padding: 3px 8px;
}

/* ── Textarea compétence ── */
.si-competence-row { margin-bottom: 8px; }
.si-competence-row textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  font-size: 14px; resize: vertical; font-family: inherit;
  box-sizing: border-box;
}

/* ── Blocs sub-tabs ── */
.si-blocs-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.si-blocs-tab {
  padding: 7px 14px; border-radius: 9px; border: 1px solid #e2e8f0;
  background: #f8fafc; color: #475569; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.si-blocs-tab.active { background: #fff; color: #0f172a; border-color: #cbd5e1; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.si-blocs-panel.hidden { display: none; }

/* ── Drop zone Word ── */
.si-blocs-drop {
  border: 2px dashed #cbd5e1; border-radius: 12px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color .15s, background .15s;
}
.si-blocs-drop:hover, .si-blocs-drop.dragover { border-color: #d97706; background: #fffbeb; }
.si-blocs-drop.loading { opacity: .7; cursor: wait; }
.si-blocs-drop-icon { font-size: 28px; }
.si-blocs-drop-label { font-size: 14px; color: #475569; }

/* ── Prévisualisation blocs parsés ── */
.si-blocs-preview { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.si-bloc-prev {
  display: flex; align-items: center; gap: 10px;
  background: #f8fafc; border-radius: 8px; padding: 7px 12px;
}
.si-bloc-prev-num {
  /* Même correctif que .si-src-bloc-num : un vrai code de bloc long ne doit
     pas être forcé dans un cercle de taille fixe. */
  min-width: 22px; padding: 3px 7px; border-radius: 6px;
  background: #d97706; color: #fff; font-size: 11px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; white-space: nowrap;
}
.si-bloc-prev span:last-child { font-size: 13px; color: #334155; }
.si-bloc-prev-more { font-size: 12px; color: #94a3b8; padding: 4px 12px; }

/* ── Textarea blocs texte ── */
#si-btab-text textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid #cbd5e1; border-radius: 10px;
  font-size: 14px; resize: vertical; font-family: inherit;
  box-sizing: border-box;
}

/* ── Canaux actifs (dans résumé) ── */
.si-channels-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.si-ch { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; color: #fff; }
.si-ch-structured { background: #BE185D; }
.si-ch-semantic   { background: #2563eb; }
.si-ch-lexical    { background: #059669; }
.si-ch-blocs      { background: #d97706; }
.si-ch-ai         { background: linear-gradient(135deg, #2563eb, #0d9488); }

/* ── Modal header ── */
.si-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; gap: 16px;
}
.si-modal-titles { flex: 1; min-width: 0; }
.si-modal-cert1, .si-modal-cert2 {
  font-size: 0.85rem; font-weight: 600; color: #0f172a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.si-modal-cert1 { font-size: 0.78rem; color: #64748b; }
.si-modal-vs { font-size: 0.68rem; color: #94a3b8; margin: 3px 0 3px 8px; }
.si-modal-badge {
  padding: 1px 7px; border-radius: 5px; font-size: 0.72rem; margin-right: 6px;
  display: inline-block; font-weight: 700;
}
.si-modal-badge-src  { background: #e0f2fe; color: #0369a1; }
.si-modal-badge-cand { background: #ccfbf1; color: #0d9488; }
.si-modal-chips { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.si-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.si-chip-fam           { background: #f1f5f9; color: #475569; }
.si-chip-conf-haute    { background: #dcfce7; color: #15803d; }
.si-chip-conf-moy      { background: #fef9c3; color: #a16207; }
.si-chip-conf-low      { background: #f3f4f6; color: #6b7280; }
.si-chip-method        { background: #dbeafe; color: #2563eb; }

/* ROME partagé banner — affiché en haut du Résumé */
.si-shared-codes-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 20px; background: #eff6ff; border-bottom: 1px solid #bfdbfe;
  font-size: 0.82rem;
}
.si-shared-codes-lbl { font-weight: 600; color: #64748b; white-space: nowrap; }
.si-modal-close {
  background: none; border: none; font-size: 1.6rem; cursor: pointer;
  color: #9ca3af; padding: 4px 8px; border-radius: 6px; line-height: 1;
}
.si-modal-close:hover { background: #f1f5f9; color: #374151; }

/* ── Modal onglets ── */
.si-modal-tabs-bar {
  display: flex; border-bottom: 1px solid #e5e7eb;
  padding: 0 24px; flex-shrink: 0; background: #fafafa;
}
.si-modal-tab {
  padding: 10px 20px; border: none; background: none;
  font-size: 0.84rem; font-weight: 500; color: #6b7280;
  border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit;
  transition: color .12s;
}
.si-modal-tab.si-mtab-active {
  font-weight: 700; color: var(--primary, #2563eb);
  border-bottom-color: var(--primary, #2563eb);
}
.si-tab-panel { padding: 24px; }
.si-tab-hidden { display: none; }

/* ── Verdict bloc-à-bloc ── */
.si-verdict-bar-wrap {
  background: #f8fafc; border-radius: 12px; padding: 16px 20px;
  margin-bottom: 20px;
}
.si-verdict-nums { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.si-verdict-big  { font-size: 1.6rem; font-weight: 800; }
.si-verdict-label { font-size: 0.9rem; font-weight: 600; color: #374151; }
.si-verdict-comps { font-size: 0.78rem; color: #6b7280; margin-left: 8px; }
.si-verdict-track { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.si-verdict-fill  { height: 100%; border-radius: 3px; transition: width .4s; }
.si-verdict-ia { font-size: 11px; color: #64748b; font-weight: 700; margin-top: 8px; }

/* ── Explication globale ── */
.si-expl-global {
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px;
  padding: 10px 14px; font-size: 0.83rem; color: #0c4a6e; line-height: 1.6;
  font-style: italic; margin-bottom: 20px; display: flex; gap: 8px;
}
.si-expl-icon { font-style: normal; flex-shrink: 0; color: #0369a1; }

/* ── Paires bloc-à-bloc ── */
.si-pairs { display: flex; flex-direction: column; gap: 8px; }
.si-pair {
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
}
.si-pair-forte { border-left: 4px solid #059669; }
.si-pair-avg   { border-left: 4px solid #d97706; }
.si-pair-none  { border-left: 4px solid #e5e7eb; opacity: .7; }
.si-pair-cand-only { border-left: 4px solid #e0f2fe; }

.si-pair-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 12px 16px; background: #fafafa;
  user-select: none;
}
.si-pair-header-toggle { cursor: pointer; }
.si-pair-header-toggle:hover { background: #f1f5f9; }
.si-pair-blocs { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.si-pair-src-lbl     { font-size: 0.85rem; font-weight: 700; color: #1e40af; line-height: 1.4; }
.si-pair-cand-lbl    { font-size: 0.85rem; font-weight: 700; color: #0d9488; line-height: 1.4; }
.si-pair-nomatch-lbl { font-size: 0.8rem; color: #94a3b8; font-style: italic; }
.si-pair-arrow  { color: #94a3b8; font-size: 1rem; flex-shrink: 0; padding: 1px 4px; }
.si-pair-right  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.si-pair-score  { font-size: 0.9rem; font-weight: 800; }
.si-pair-chevron { font-size: 0.85rem; color: #94a3b8; }

.si-pair-body { border-top: 1px solid #e5e7eb; display: none; }
.si-pair-body.si-pair-body-open { display: block; }

/* Explanation inside pair */
.si-pair-expl {
  padding: 10px 16px; background: #f0f9ff;
  border-bottom: 1px solid #e0f2fe;
  font-size: 0.8rem; color: #0c4a6e; font-style: italic;
  display: flex; gap: 8px; line-height: 1.5;
}
.si-pair-expl .si-expl-icon { color: #0369a1; font-style: normal; }

/* ── Compétences 2 colonnes ── */
.si-comp-cols-header {
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 9px 16px; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.si-comp-col-hd {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  display: flex; flex-direction: column; gap: 2px;
}
.si-comp-col-hd-src  { color: #1e40af; }
.si-comp-col-hd-cand { color: #0d9488; }
.si-col-bloc-name {
  font-size: 0.72rem; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: #64748b; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.si-comp-row {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.81rem; line-height: 1.55;
}
.si-comp-row:last-child { border-bottom: none; }
.si-comp-left  { display: flex; gap: 9px; padding: 10px 10px 10px 18px; align-items: flex-start; }
.si-comp-right { padding: 10px 18px 10px 10px; border-left: 1px solid #e5e7eb; align-items: flex-start; display: flex; flex-direction: column; gap: 0; }
.si-comp-check { flex-shrink: 0; font-weight: 700; font-size: 0.75rem; margin-top: 1px; }
.si-comp-match    .si-comp-check { color: #059669; }
.si-comp-nomatch  .si-comp-check { color: #dc2626; }
.si-comp-text       { color: #374151; min-width: 0; }
.si-comp-match-text { color: #374151; font-style: normal; min-width: 0; }
.si-comp-nodiff     { color: #cbd5e1; font-style: italic; }
.si-comp-nomatch .si-comp-right { background: #fef2f2; }

/* ── Blocs candidat non matchés ── */
.si-unmatched-title {
  font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase;
  letter-spacing: .04em; margin: 20px 0 8px; padding: 0 24px;
}

/* ══════════════════════════════════════════════════════
   TAB BLOCS — vue côte à côte du texte intégral
   ══════════════════════════════════════════════════════ */

.si-bpair {
  border: 1px solid #e5e7eb; border-radius: 10px;
  margin: 0 0 14px; overflow: hidden;
}
.si-bpair-forte   { border-left: 4px solid #059669; }
.si-bpair-avg     { border-left: 4px solid #d97706; }
.si-bpair-none    { border-left: 4px solid #e5e7eb; opacity: .8; }
.si-bpair-cand-only { border-left: 4px solid #e0f2fe; }

/* Titres des blocs source / candidat */
.si-bpair-titles {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; background: #fafafa; border-bottom: 1px solid #e5e7eb;
}
.si-bpair-src-title  { font-size: 0.87rem; font-weight: 700; color: #1e40af; flex: 1; min-width: 160px; }
.si-bpair-cand-title { font-size: 0.87rem; font-weight: 700; color: #0d9488; flex: 1; min-width: 160px; }
.si-bpair-score-badge {
  font-size: 0.85rem; font-weight: 800; border: 1px solid; border-radius: 6px;
  padding: 1px 8px; flex-shrink: 0; white-space: nowrap;
}
.si-bpair-nomatch { font-size: 0.78rem; color: #94a3b8; font-style: italic; }
.si-bpair-arrow   { font-size: 0.9rem; color: #94a3b8; flex-shrink: 0; padding: 0 2px; }

/* Explication Mistral sous les titres */
.si-bpair-expl {
  padding: 9px 16px; background: #f0f9ff; border-bottom: 1px solid #e0f2fe;
  font-size: 0.82rem; color: #0c4a6e; font-style: italic; line-height: 1.55;
}
.si-bpair-expl strong { font-style: normal; font-weight: 700; color: #0369a1; }
.si-bpair-expl em     { font-style: italic; color: #0369a1; }

/* Corps 2 colonnes (texte complet) */
.si-bpair-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.si-bpair-col {
  padding: 14px 16px;
}
.si-bpair-col:nth-child(2) { border-left: 1px solid #e5e7eb; }
.si-bpair-col-hd {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 10px;
}
.si-comp-list {
  margin: 0; padding: 0; list-style: none;
}
.si-comp-list li {
  font-size: 0.82rem; color: #374151; line-height: 1.5;
  padding: 4px 0 4px 14px; position: relative; border-bottom: 1px solid #f8fafc;
}
.si-comp-list li:last-child { border-bottom: none; }
.si-comp-list li::before {
  content: '•'; position: absolute; left: 0; color: #94a3b8; font-weight: 700;
}
.si-comp-empty { font-size: 0.8rem; color: #94a3b8; font-style: italic; line-height: 1.5; }

/* ══════════════════════════════════════════════════════
   TAB COMPÉTENCES — matching ligne à ligne
   ══════════════════════════════════════════════════════ */

.si-cmatch-section { margin-bottom: 28px; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.si-cmatch-header {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 12px 18px; background: #fafafa; border-bottom: 1px solid #e5e7eb;
}
.si-cmatch-header-row1 { display: flex; align-items: center; gap: 8px; }
.si-cmatch-header-row2 { display: flex; align-items: center; gap: 8px; padding-left: 2px; }
.si-cmatch-src  { font-size: 0.87rem; font-weight: 700; color: #1e40af; }
.si-cmatch-cand { font-size: 0.85rem; font-weight: 600; color: #0d9488; }
.si-cmatch-sep  { font-size: 0.72rem; color: #94a3b8; font-weight: 500; white-space: nowrap; }
.si-pair-nomatch-lbl { font-size: 0.76rem; color: #94a3b8; padding-left: 2px; }
.si-cmatch-expl {
  padding: 12px 20px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
  border-left: 3px solid #bfdbfe;
  font-size: 0.83rem; color: #374151; line-height: 1.75;
}
.si-cmatch-expl p { margin: 0 0 6px; }
.si-cmatch-expl p:last-child { margin-bottom: 0; }
.si-cmatch-expl strong { font-weight: 700; color: #1e3a8a; }
.si-cmatch-expl em { font-style: normal; color: #0369a1; }
.si-cmatch-expl ul.si-md-list { margin: 4px 0 6px 0; padding-left: 18px; }
.si-cmatch-expl ul.si-md-list li { margin: 2px 0; }

/* ── Fallback : texte brut côte à côte (quand pas de matching Jaccard) ── */
.si-comp-rawblock {
  display: grid; grid-template-columns: 1fr 1fr;
}
.si-comp-rawblock-col { padding: 12px 16px; }
.si-comp-rawblock-col:nth-child(2) { border-left: 1px solid #e5e7eb; }
.si-comp-rawblock-hd {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 8px;
}
.si-comp-rawblock-text {
  font-size: 0.82rem; color: #334155; line-height: 1.65;
  white-space: pre-line;
}

/* ── Texte compétence dans le tab Compétences (colonne alignée) ── */
.si-comp-right .si-comp-text { color: #374151; }

/* ══════════════════════════════════════════════════════
   TAB RÉSUMÉ — poids + codes
   ══════════════════════════════════════════════════════ */

.si-resume-tier {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
}
.si-resume-tier-label { font-size: 0.75rem; font-weight: 700; color: #64748b; text-transform: uppercase; }
.si-resume-tier-val   { font-size: 1.1rem; font-weight: 800; }
.si-resume-tier-sub   { font-size: 0.8rem; color: #64748b; margin-left: auto; }

.si-expl-block {
  display: flex; gap: 14px; background: #f0f9ff; border: 1px solid #bae6fd;
  border-radius: 12px; padding: 18px 22px; margin-bottom: 24px;
}
.si-expl-block-icon { color: #0369a1; font-size: 1rem; flex-shrink: 0; margin-top: 3px; }
.si-expl-block-text {
  font-size: 0.84rem; color: #0c4a6e; font-style: italic;
  line-height: 1.75; min-width: 0;
}
.si-expl-block-text p { margin: 0 0 10px; }
.si-expl-block-text p:last-child { margin-bottom: 0; }
.si-expl-block-text strong { font-style: normal; font-weight: 700; color: #0369a1; }
.si-expl-block-text em { color: #0369a1; }

/* Onglets "1 page par compétence" (mode compétence, N>1) */
.si-comp-tabs-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 4px;
}
.si-comp-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border, #e2e5e1); background: var(--card, #fff);
  font-size: 0.8rem; font-weight: 500; color: var(--text-muted, #5b6570);
  cursor: pointer; font-family: inherit; transition: all .12s;
}
.si-comp-tab:hover { border-color: var(--primary, #146356); }
.si-comp-tab-active {
  background: var(--primary, #146356); border-color: var(--primary, #146356);
  color: #fff; font-weight: 700;
}
.si-comp-tab-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; font-size: 0.68rem; font-weight: 700;
  background: rgba(0,0,0,0.08); flex-shrink: 0;
}
.si-comp-tab-active .si-comp-tab-num { background: rgba(255,255,255,0.25); }
.si-comp-tab-lbl { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-comp-tab-count {
  font-size: 0.7rem; font-weight: 700; opacity: 0.75; flex-shrink: 0;
}

/* Skeleton de chargement — analyse IA en arrière-plan (jusqu'à ~15-20s) */
.si-skeleton-block { padding: 18px 22px; margin-bottom: 24px; }
.si-skeleton-line {
  height: 12px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, #e2e8f0 25%, #eef2f7 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  animation: si-skeleton-shimmer 1.4s ease infinite;
}
.si-skeleton-line:last-child { margin-bottom: 0; }
@keyframes si-skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Résumé global Mistral */
.si-global-summary {
  background: #eff6ff; border-color: #bfdbfe;
  padding: 20px 24px;
}
.si-global-summary .si-expl-block-icon { color: #2563eb; }
.si-global-summary .si-expl-block-text { color: #0c4a6e; line-height: 1.8; }
.si-global-summary .si-expl-block-text strong { color: #0369a1; }
.si-global-summary .si-expl-block-text p { margin-bottom: 12px; }

.si-resume-weights { background: #f8fafc; border-radius: 10px; padding: 14px 16px; margin-bottom: 20px; }
.si-resume-weights-title {
  font-size: 0.72rem; font-weight: 800; color: #64748b; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 12px;
}
.si-weight-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid #e5e7eb;
}
.si-weight-row:last-child { border-bottom: none; }
.si-weight-label { font-size: 0.83rem; color: #374151; flex: 1; }
.si-weight-poids { font-size: 0.75rem; font-weight: 800; min-width: 35px; text-align: right; }
.si-weight-val   { font-size: 0.8rem; color: #64748b; min-width: 160px; text-align: right; }

/* ── Résumé tab — codes ── */
.si-info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.si-codes-section { margin-bottom: 14px; }
.si-codes-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ── Pills famille ── */
.labo-pill-equivalent   { background: #dbeafe; color: #2563eb; }
.labo-pill-domain       { background: #e0f2fe; color: #0369a1; }
.labo-pill-competences  { background: #d1fae5; color: #065f46; }
.labo-pill-autre        { background: #f1f5f9; color: #475569; }

/* ── Bordures groupes famille ── */
.labo-group-identique   { border-left: 3px solid #146356; }
.labo-group-similaire   { border-left: 3px solid #0ea5e9; }
.labo-group-impensable  { border-left: 3px solid #BE185D; }
.labo-group-faible      { border-left: 3px solid #94a3b8; }

/* ── Carte cliquable ── */
.si-card-clickable { cursor: pointer; transition: box-shadow .15s, transform .1s; }
.si-card-clickable:hover { box-shadow: 0 4px 16px rgba(37,99,235,.12); transform: translateY(-1px); }

/* ── Infos dans la modale résumé ── */
.si-info-block {
  background: #f8fafc; border-radius: 9px; padding: 10px 14px;
}
.si-info-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.si-info-val   { font-size: 14px; font-weight: 600; color: #0f172a; }

/* ── Conteneur résultats (dans la main area) ── */
.si-results-layout { display: block; margin-top: 4px; }

/* ── Sidebar ── */
.si-sidebar {
  position: sticky;
  top: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.si-sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 0 4px 10px;
}

.si-sfam {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
  font-size: 0.84rem;
  color: #374151;
  margin-bottom: 2px;
}
.si-sfam:hover { background: #f1f5f9; }
.si-sfam.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
.si-sfam-icon { font-size: 0.9rem; flex-shrink: 0; }
.si-sfam-label { flex: 1; }
.si-sfam-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}
.si-sfam.active .si-sfam-count {
  background: #dbeafe;
  color: #1d4ed8;
}

.si-sidebar-sep {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 10px 0;
}

/* Type RNCP/RS/Tous */
.si-sidebar-type {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.si-stype {
  padding: 6px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.83rem;
  color: #64748b;
  text-align: left;
  transition: background .12s;
  font-weight: 500;
}
.si-stype:hover { background: #f1f5f9; }
.si-stype.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }

/* ── Titre section sidebar ── */
.si-sidebar-section-title {
  font-size: 0.68rem; font-weight: 800; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 0 4px 8px; margin-top: 4px;
}

/* ── Boutons mode (sidebar gauche) ── */
.si-sidebar-modes { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.si-smode-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid transparent; background: transparent;
  cursor: pointer; text-align: left; transition: background .12s, border-color .12s;
}
.si-smode-btn:hover { background: #f1f5f9; }
.si-smode-btn.active {
  background: #eff6ff; border-color: #bfdbfe;
}
.si-smode-icon  { font-size: 1.1rem; flex-shrink: 0; }
.si-smode-label { font-size: 0.83rem; font-weight: 600; color: #0f172a; line-height: 1.3; }
.si-smode-btn.active .si-smode-label { color: #1d4ed8; }

.si-smode-btn.si-smode-locked .si-smode-label { filter: blur(2.5px); user-select: none; }
.si-smode-premium-badge {
  margin-left: auto; font-size: 0.62rem; font-weight: 800; letter-spacing: .03em;
  color: var(--accent, #C6741F); background: var(--accent-light, #FBEEE3);
  padding: 2px 7px; border-radius: 999px; flex-shrink: 0;
}

/* ── Panneau verrouillé (fonctionnalité Premium) ── */
.si-locked-panel {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 32px 28px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fafafa;
}
.si-locked-badge {
  font-size: 0.68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent, #C6741F); background: var(--accent-light, #FBEEE3);
  padding: 4px 10px; border-radius: 999px;
}
.si-locked-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: #0f172a; }
.si-locked-text  { margin: 0; font-size: 0.88rem; color: #64748b; line-height: 1.6; max-width: 480px; }
.si-locked-confirm { margin: 8px 0 0; font-size: 0.82rem; color: #146356; font-weight: 600; }

/* ── Historique sidebar ── */
.si-hist-entry {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  text-align: left; transition: background .12s; margin-bottom: 2px;
}
.si-hist-entry:hover { background: #f8fafc; }
.si-hist-icon  { font-size: 0.9rem; flex-shrink: 0; opacity: .6; }
.si-hist-label { font-size: 0.78rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* Filtres ROME + Niveau */
.si-sidebar-filter-lbl {
  display: flex;
  flex-direction: column;
  font-size: 0.73rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  gap: 5px;
  margin-bottom: 10px;
}
.si-sidebar-filter-lbl select {
  font-size: 0.8rem;
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #374151;
  cursor: pointer;
  font-weight: 400;
}
.si-sidebar-filter-lbl select:focus { outline: 2px solid #bfdbfe; }

/* ── Bouton recherche — état chargement ── */
.si-btn-loading {
  opacity: 0.75;
  cursor: not-allowed;
  background: #93c5fd !important;
}

/* ── Badge de bloc dans l'en-tête de section ── */
.si-src-bloc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: #64748b;
  border-radius: 5px;
  padding: 2px 7px;
  margin-right: 6px;
  letter-spacing: .04em;
  flex-shrink: 0;
}

/* ── Tag de bloc dans la colonne droite (B01, B02…) ── */
.si-cand-bloc-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0d9488;
  background: #ccfbf1;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 7px;
  flex-shrink: 0;
  letter-spacing: .03em;
  vertical-align: middle;
}
.si-comp-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
/* Tag source (colonne gauche) — bleu indigo */
.si-src-tag { background: #1d4ed8; color: #fff; }

.si-comp-nomatch-lbl { color: #cbd5e1; font-size: 0.82rem; }
.si-comp-absent { color: #94a3b8; }
.si-col-best-match-lbl { color: #0d9488; font-style: normal; font-weight: 600; }
.si-cmatch-cand-only { color: #374151; }
.si-cmatch-unmatched { opacity: 0.85; }

/* ── Tab "Blocs" — vue visuelle brute ── */
.si-bv-wrap { padding: 4px 0; }
.si-bv-global-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 2px solid #e2e8f0;
  padding: 10px 20px 8px;
}
.si-bv-global-num {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.si-bv-global-num-cand { color: #0d9488; }

.si-bv-section {
  border-bottom: 1px solid #f1f5f9;
  padding: 0;
  margin: 0;
}
.si-bv-section-cand-only { background: #faf5ff08; }

.si-bv-cols-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 10px 20px 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.si-bv-col-hd {
  display: flex;
  align-items: center;
  gap: 8px;
}
.si-bv-col-hd-cand { padding-left: 16px; border-left: 1px solid #e2e8f0; }
.si-bv-bloc-name { font-size: 0.84rem; font-weight: 600; color: #1e293b; }
.si-bv-no-match  { font-size: 0.8rem; color: #94a3b8; font-style: italic; }
.si-bv-cand-only-badge {
  font-size: 0.69rem; font-weight: 700; color: #0d9488;
  background: #ccfbf1; border-radius: 4px; padding: 1px 6px; margin-left: 6px;
}

.si-bv-rows { display: grid; grid-template-columns: 1fr 1fr; }
.si-bv-row { display: contents; }
.si-bv-row:nth-child(even) .si-bv-cell { background: #f8fafc; }
.si-bv-cell {
  padding: 9px 20px;
  font-size: 0.83rem;
  color: #334155;
  line-height: 1.55;
  border-bottom: 1px solid #f1f5f9;
  min-height: 38px;
}
.si-bv-cell-cand {
  border-left: 1px solid #e2e8f0;
  color: #8A4914;
  padding-left: 16px;
}
.si-bv-cell:empty { background: #fafafa; }

/* ── Markdown dans l'analyse ── */
.si-md-hr { border: none; border-top: 1px solid #e2e8f0; margin: 14px 0; }
.si-md-h3 { font-weight: 700; font-size: 0.9rem; color: #1e3a8a; margin: 10px 0 5px; }
.si-md-ol { margin: 4px 0 10px 0; padding-left: 20px; }
.si-md-ol li { margin: 3px 0; font-size: 0.875rem; line-height: 1.5; }
.si-md-arrow { color: #2563eb; font-style: italic; font-size: 0.85rem; margin: 4px 0 6px 8px; padding-left: 8px; border-left: 2px solid #bfdbfe; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .si-body-layout { grid-template-columns: 1fr; }
  .si-sidebar {
    position: static;
    display: flex; flex-direction: row; flex-wrap: wrap;
    gap: 6px; padding: 10px;
  }
  .si-sidebar-section-title, .si-sidebar-sep { display: none; }
  .si-sidebar-modes { flex-direction: row; flex-wrap: wrap; }
  .si-smode-btn { width: auto; }
  .si-sfam, .si-stype, .si-sidebar-filter-lbl { width: auto; }
}

/* ── Bandeau info après import Word ── */
.si-word-hint {
  font-size: 0.82rem; color: #374151;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 8px 14px; margin-bottom: 10px;
  line-height: 1.5;
}

/* ── Case "j'accepte 1 crédit" (mode blocs) ── */
.si-blocs-consent {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.82rem; color: #475569; line-height: 1.4;
  margin-top: 10px; cursor: pointer; user-select: none;
}
.si-blocs-consent input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; accent-color: #059669; cursor: pointer;
}

/* ── Popup confirmation crédit ── */
.si-credit-modal{position:fixed;inset:0;z-index:100000;display:flex;align-items:center;justify-content:center;}
.si-credit-overlay{position:absolute;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(2px);}
.si-credit-box{position:relative;background:#fff;border-radius:16px;padding:26px 28px;width:92%;max-width:380px;box-shadow:0 20px 50px rgba(0,0,0,.25);text-align:center;}
.si-credit-title{font-size:1.05rem;font-weight:700;color:#0f172a;margin-bottom:10px;}
.si-credit-text{font-size:.9rem;color:#475569;line-height:1.6;margin-bottom:20px;}
.si-credit-actions{display:flex;gap:10px;justify-content:center;}
.si-credit-actions button{padding:10px 18px;border-radius:10px;font-size:.88rem;font-weight:600;cursor:pointer;border:1px solid transparent;font-family:inherit;}
.si-credit-cancel{background:#f1f5f9;color:#475569;border-color:#e2e8f0;}
.si-credit-cancel:hover{background:#e2e8f0;}
.si-credit-ok{background:#059669;color:#fff;}
.si-credit-ok:hover{background:#047857;}

/* ── Fiche inactive : reste visible/cliquable dans les résultats, grisée ── */
.si-card-inactive{opacity:.62;filter:grayscale(.35);}
.si-card-inactive:hover{opacity:.85;}

/* ── Sélecteur du nombre de compétences (mode "Par compétence") ── */
.si-compcount-btn{
  min-width:30px;padding:5px 10px;border-radius:7px;border:1px solid #e2e8f0;
  background:#fff;color:#64748b;cursor:pointer;font-size:0.83rem;font-weight:600;
  transition:background .12s,border-color .12s;
}
.si-compcount-btn:hover{background:#f1f5f9;}
.si-compcount-btn.active{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe;}

/* ── Mobile : les grilles de comparaison passent en 1 colonne ── */
@media (max-width: 768px) {
  .si-comp-cols-header,
  .si-comp-row,
  .si-bpair-body,
  .si-comp-rawblock,
  .si-bv-global-header,
  .si-bv-cols-header,
  .si-bv-rows {
    grid-template-columns: 1fr;
  }
}
