/* ═══════════════════════════════════════════════════════════════════════════
   RAFFINSTOCK v6.3.0 — DESIGN SYSTEM LIQUID GLASS : BIBLIOTHÈQUE DE FORMATION
   Direction artistique : Apple visionOS · Liquid Glass · Linear · SaaS LMS Pro
   Palette : Bleu nuit profond (#06132a) · Bleu industriel (#0b5aa8 / #0284c7)
             Blanc cassé (#f3f6fb) · Gris graphite (#1e293b) · Cyan (#38bdf8) · Orange (#fa8b05)
   Compatible Thème Clair (défaut / html.rx-clair) & Thème Nuit (html.rx-nuit)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --flg-navy: #06132a;
  --flg-navy-2: #0b2144;
  --flg-blue: #0b5aa8;
  --flg-blue-bright: #0284c7;
  --flg-cyan: #38bdf8;
  --flg-orange: #fa8b05;
  --flg-emerald: #10b981;
  --flg-graphite: #1e293b;
  --flg-offwhite: #f3f6fb;

  /* Surfaces Liquid Glass (Mode Clair) */
  --flg-surface: rgba(255, 255, 255, 0.78);
  --flg-surface-strong: rgba(255, 255, 255, 0.92);
  --flg-surface-soft: rgba(243, 246, 251, 0.75);
  --flg-border: rgba(15, 31, 56, 0.11);
  --flg-border-spec: rgba(255, 255, 255, 0.85);
  --flg-text: #0f172a;
  --flg-text-soft: #334155;
  --flg-text-muted: #64748b;
  --flg-shadow-card: 0 14px 34px -10px rgba(6, 19, 42, 0.12), 0 3px 10px -2px rgba(6, 19, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --flg-shadow-hover: 0 22px 44px -12px rgba(11, 90, 168, 0.24), 0 6px 16px -4px rgba(6, 19, 42, 0.1), inset 0 1px 0 #ffffff;
}

html.rx-nuit {
  --flg-surface: rgba(13, 25, 48, 0.78);
  --flg-surface-strong: rgba(15, 29, 56, 0.92);
  --flg-surface-soft: rgba(10, 20, 38, 0.72);
  --flg-border: rgba(125, 211, 252, 0.18);
  --flg-border-spec: rgba(255, 255, 255, 0.12);
  --flg-text: #f1f5f9;
  --flg-text-soft: #cbd5e1;
  --flg-text-muted: #94a3b8;
  --flg-shadow-card: 0 16px 36px -10px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --flg-shadow-hover: 0 22px 48px -10px rgba(14, 165, 233, 0.32), inset 0 1px 0 rgba(125, 211, 252, 0.28);
}

/* ═══════════════════════════════════════════════════════════════════════════
   1. AMÉLIORATION DE LA SIDEBAR GÉNÉRALE (#tabbar) & MISE EN VALEUR FORMATION
   ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1180px) {
  #tabbar.tabs {
    padding: 16px 12px 24px !important;
    gap: 5px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(243, 246, 251, 0.76) 100%) !important;
    backdrop-filter: blur(26px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(26px) saturate(190%) !important;
    border-right: 1px solid rgba(15, 31, 56, 0.1) !important;
    box-shadow: 6px 0 28px -12px rgba(6, 19, 42, 0.08), inset -1px 0 0 rgba(255, 255, 255, 0.8) !important;
  }
  html.rx-nuit #tabbar.tabs {
    background: linear-gradient(180deg, rgba(8, 17, 34, 0.9) 0%, rgba(6, 13, 26, 0.86) 100%) !important;
    border-right: 1px solid rgba(125, 211, 252, 0.14) !important;
    box-shadow: 8px 0 32px -12px rgba(0, 0, 0, 0.55), inset -1px 0 0 rgba(255, 255, 255, 0.06) !important;
  }

  #tabbar.tabs .tab {
    position: relative;
    padding: 10px 13px !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.2s ease, box-shadow 0.2s ease, color 0.18s ease !important;
  }

  #tabbar.tabs .tab svg {
    width: 18px !important;
    height: 18px !important;
    padding: 4px;
    box-sizing: content-box;
    border-radius: 9px;
    background: rgba(11, 90, 168, 0.06);
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  }
  html.rx-nuit #tabbar.tabs .tab svg {
    background: rgba(56, 189, 248, 0.08);
  }

  #tabbar.tabs .tab:hover:not(.active) {
    transform: translateX(3px);
    background: rgba(11, 90, 168, 0.08) !important;
  }
  html.rx-nuit #tabbar.tabs .tab:hover:not(.active) {
    background: rgba(56, 189, 248, 0.12) !important;
  }

  /* Séparateur visuel subtil au-dessus du pôle 3D & Formation */
  #tabbar.tabs .tab[data-v="parc"],
  #tabbar.tabs .tab[data-v="learn"] {
    margin-top: 6px !important;
  }
  #tabbar.tabs .tab[data-v="parc"]::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 12px;
    right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.32), transparent);
    pointer-events: none;
  }

  /* État actif élégant avec barre lumineuse latérale */
  #tabbar.tabs .tab.active {
    font-weight: 700 !important;
    box-shadow: 0 8px 20px -6px rgba(11, 90, 168, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  }
  #tabbar.tabs .tab.active::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 22%;
    bottom: 22%;
    width: 3.5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #fa8b05);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.65);
  }

  /* Mise en valeur spéciale de la rubrique FORMATION */
  #tabbar.tabs .tab[data-v="learn"]:not(.active) {
    background: linear-gradient(135deg, rgba(11, 90, 168, 0.1), rgba(250, 139, 5, 0.08)) !important;
    border: 1px solid rgba(11, 90, 168, 0.22) !important;
    color: var(--flg-blue) !important;
    font-weight: 700 !important;
  }
  html.rx-nuit #tabbar.tabs .tab[data-v="learn"]:not(.active) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(250, 139, 5, 0.1)) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    color: #7dd3fc !important;
  }
  #tabbar.tabs .tab[data-v="learn"].active {
    background: linear-gradient(135deg, #061b3a 0%, #0b5aa8 62%, #0284c7 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(125, 211, 252, 0.45) !important;
    box-shadow: 0 10px 24px -6px rgba(11, 90, 168, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  }
  #tabbar.tabs .tab[data-v="learn"].active svg {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #38bdf8 !important;
  }
  #tabbar.tabs .tab[data-v="learn"] span::after {
    content: "LMS";
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: rgba(56, 189, 248, 0.18);
    color: #0284c7;
    border: 1px solid rgba(56, 189, 248, 0.35);
  }
  html.rx-nuit #tabbar.tabs .tab[data-v="learn"] span::after,
  #tabbar.tabs .tab[data-v="learn"].active span::after {
    background: rgba(56, 189, 248, 0.24);
    color: #e0f2fe;
    border-color: rgba(125, 211, 252, 0.45);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. CONTENEUR PRINCIPAL & EN-TÊTE ÉDITORIAL (#v-learn .flg-library)
   ═══════════════════════════════════════════════════════════════════════════ */
#v-learn .lx.lx-mod {
  max-width: 1380px !important;
  margin: 0 auto !important;
  padding: 6px 4px 36px !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* En-tête éditorial Liquid Glass Bleu Nuit Profond */
#v-learn .lx-mod .flg-editorial-hero,
.flg-editorial-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px !important;
  padding: 26px 28px !important;
  background:
    radial-gradient(900px 380px at 92% -10%, rgba(56, 189, 248, 0.28), transparent 60%),
    radial-gradient(650px 320px at 8% 110%, rgba(250, 139, 5, 0.2), transparent 62%),
    linear-gradient(135deg, #051126 0%, #091e3e 48%, #0c2b59 100%) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(125, 211, 252, 0.32) !important;
  box-shadow: 0 24px 54px -16px rgba(4, 12, 28, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

.flg-hero-top {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.flg-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.flg-eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.flg-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.35);
  backdrop-filter: blur(10px);
}
.flg-pill-badge.amber {
  background: rgba(250, 139, 5, 0.2);
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.4);
}
.flg-pill-badge.soft {
  background: rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.16);
}

.flg-hero-title {
  margin: 0 !important;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif !important;
  font-size: clamp(26px, 3vw, 36px) !important;
  font-weight: 800 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em !important;
  color: #ffffff !important;
}

.flg-hero-lead {
  margin: 0 !important;
  font-size: 14.5px !important;
  line-height: 1.6 !important;
  color: #cbd5e1 !important;
  max-width: 68ch;
}

/* Grille des 4 KPIs réels de la Bibliothèque */
.flg-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.flg-kpi-card {
  position: relative;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.flg-kpi-card.kpi-progress {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(16, 185, 129, 0.16));
  border-color: rgba(56, 189, 248, 0.42);
}
.flg-kpi-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.flg-kpi-val small {
  font-size: 11.5px;
  font-weight: 600;
  color: #7dd3fc;
}
.flg-kpi-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
}
.flg-kpi-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin-top: 5px;
}
.flg-kpi-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  transition: width 0.35s ease;
}

/* Carte vedette : Formation recommandée / À reprendre */
.flg-featured-card {
  position: relative;
  border-radius: 18px;
  background: rgba(7, 18, 38, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.3);
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.flg-featured-card .flg-card-media {
  height: 126px;
}
.flg-featured-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.flg-featured-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fde047;
}
.flg-featured-title {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
}
.flg-featured-sub {
  margin: 0;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.45;
}
.flg-featured-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.flg-btn-primary {
  appearance: none;
  border: 1px solid rgba(125, 211, 252, 0.55);
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7 0%, #0b5aa8 55%, #fa8b05 140%);
  box-shadow: 0 8px 20px -6px rgba(2, 132, 199, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.flg-btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 12px 26px -6px rgba(56, 189, 248, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.flg-btn-glass {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.flg-btn-glass:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(125, 211, 252, 0.45);
  transform: translateY(-1px);
}

/* Passerelles rapides vers l'Académie 97 matières, les 6 Livres, Normes & Ateliers 3D */
.flg-ecosystem-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  align-items: center;
  justify-content: space-between;
}
.flg-eco-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. POSTE DE CONTRÔLE : RECHERCHE, NAVIGATION CATÉGORIES, STATUT & TRI
   ═══════════════════════════════════════════════════════════════════════════ */
.flg-control-deck {
  position: relative;
  border-radius: 20px;
  padding: 18px 20px;
  background: var(--flg-surface-strong);
  border: 1px solid var(--flg-border);
  box-shadow: var(--flg-shadow-card);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flg-search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.flg-search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.flg-search-box .flg-search-ico {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--flg-blue-bright);
  pointer-events: none;
}
.flg-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 16px 11px 42px !important;
  border-radius: 13px !important;
  border: 1px solid var(--flg-border) !important;
  background: var(--flg-surface-soft) !important;
  color: var(--flg-text) !important;
  font-size: 14px !important;
  font-weight: 500;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.flg-search-input:focus {
  outline: none !important;
  border-color: var(--flg-blue-bright) !important;
  box-shadow: 0 0 0 3.5px rgba(14, 165, 233, 0.18) !important;
  background: var(--flg-surface-strong) !important;
}

.flg-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.flg-sort-wrap label {
  font-size: 12px;
  font-weight: 700;
  color: var(--flg-text-muted);
  white-space: nowrap;
}
.flg-sort-select {
  appearance: none;
  padding: 10px 30px 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--flg-border);
  background: var(--flg-surface-soft);
  color: var(--flg-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Filtres par statut (Tous / Nouveau / En cours / Terminé) */
.flg-status-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: var(--flg-surface-soft);
  border: 1px solid var(--flg-border);
}
.flg-st-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--flg-text-soft);
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
}
.flg-st-btn:hover {
  color: var(--flg-text);
  background: rgba(14, 165, 233, 0.1);
}
.flg-st-btn.on {
  background: linear-gradient(135deg, #0b5aa8, #0284c7);
  color: #ffffff;
  box-shadow: 0 4px 12px -2px rgba(2, 132, 199, 0.4);
}

/* Navigation moderne des catégories (Pills Liquid Glass avec icônes & compteurs) */
.flg-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}

.flg-cat-pill {
  appearance: none;
  border: 1px solid var(--flg-border);
  background: var(--flg-surface-soft);
  color: var(--flg-text-soft);
  padding: 8px 13px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.flg-cat-pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}
.flg-cat-pill .flg-cat-cnt {
  padding: 1.5px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(148, 163, 184, 0.18);
  color: var(--flg-text-muted);
}
.flg-cat-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.45);
  color: var(--flg-text);
}
.flg-cat-pill.on {
  background: linear-gradient(135deg, #061b3a 0%, #0b5aa8 60%, #0284c7 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 8px 18px -6px rgba(11, 90, 168, 0.45);
}
.flg-cat-pill.on .flg-cat-cnt {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Barre de synthèse des résultats */
.flg-results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--flg-text-muted);
  padding: 0 4px;
}
.flg-results-meta b {
  color: var(--flg-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. SECTIONS DE CATÉGORIES & NOUVELLES CARTES DE FORMATION (.flg-card)
   ═══════════════════════════════════════════════════════════════════════════ */
.flg-section-grp {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: 15px;
  background: var(--flg-surface);
  border: 1px solid var(--flg-border);
  box-shadow: inset 0 1px 0 var(--flg-border-spec);
}
.flg-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flg-section-title .flg-sec-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(11, 90, 168, 0.14), rgba(56, 189, 248, 0.18));
  color: var(--flg-blue-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.flg-section-title .flg-sec-ico svg {
  width: 18px;
  height: 18px;
}
.flg-section-title h3 {
  margin: 0 !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--flg-text) !important;
}
.flg-section-prog {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--flg-text-muted);
}
.flg-section-bar {
  width: 110px;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.flg-section-bar > em {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b5aa8, #38bdf8, #10b981);
}

/* Grille de cartes responsive 3 colonnes → 2 colonnes → 1 colonne */
#v-learn .lx-cards.flg-cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 18px !important;
}

/* CARTE DE FORMATION PREMIUM LIQUID GLASS (.flg-card)
   Volontairement toujours sombre, comme le bandeau éditorial au-dessus : la bibliothèque
   garde son identité "Liquid Glass" même quand le reste de l'app est en thème clair
   (défaut), pour éviter la rupture visuelle grille blanche sous bandeau sombre. */
#v-learn .lx-card.flg-card,
#v-learn .lx-pcard.flg-card,
.ap-ccard.flg-card,
.bl-bk.flg-card {
  --flg-surface: rgba(13, 25, 48, 0.78);
  --flg-surface-strong: rgba(15, 29, 56, 0.92);
  --flg-surface-soft: rgba(10, 20, 38, 0.72);
  --flg-border: rgba(125, 211, 252, 0.18);
  --flg-border-spec: rgba(255, 255, 255, 0.12);
  --flg-text: #f1f5f9;
  --flg-text-soft: #cbd5e1;
  --flg-text-muted: #94a3b8;
  --flg-shadow-card: 0 16px 36px -10px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --flg-shadow-hover: 0 22px 48px -10px rgba(14, 165, 233, 0.32), inset 0 1px 0 rgba(125, 211, 252, 0.28);
  appearance: none;
  text-align: left;
  width: 100%;
  padding: 0 !important;
  border-radius: 20px !important;
  background: var(--flg-surface-strong) !important;
  border: 1px solid var(--flg-border) !important;
  border-top: 3px solid var(--tc, rgba(125, 211, 252, 0.4)) !important;
  box-shadow: var(--flg-shadow-card) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  cursor: pointer;
  position: relative;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease, border-color 0.22s ease !important;
}

#v-learn .lx-card.flg-card:hover,
#v-learn .lx-pcard.flg-card:hover,
.ap-ccard.flg-card:hover,
.bl-bk.flg-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(14, 165, 233, 0.48) !important;
  box-shadow: var(--flg-shadow-hover) !important;
}

/* 1. Zone visuelle supérieure illustrée (.flg-card-media) */
.flg-card-media {
  position: relative;
  width: 100%;
  height: 152px;
  overflow: hidden;
  background: #06152d;
  border-bottom: 1px solid rgba(125, 211, 252, 0.18);
  flex-shrink: 0;
}
.flg-card-media .flg-scene-svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.flg-card:hover .flg-card-media .flg-scene-svg {
  transform: scale(1.045);
}

.flg-media-top {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* Badge de catégorie en verre dépoli */
.flg-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  background: rgba(6, 19, 42, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 72%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.flg-cat-chip .flg-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--flg-acc, #38bdf8);
}

/* Statut visuel distinct : Nouveau / En cours / Terminé */
.flg-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}
.flg-status-pill.st-new {
  background: rgba(14, 165, 233, 0.25);
  color: #e0f2fe;
  border: 1px solid rgba(56, 189, 248, 0.48);
}
.flg-status-pill.st-run {
  background: rgba(245, 158, 11, 0.28);
  color: #fef3c7;
  border: 1px solid rgba(251, 191, 36, 0.55);
}
.flg-status-pill.st-done {
  background: rgba(16, 185, 129, 0.28);
  color: #d1fae5;
  border: 1px solid rgba(52, 211, 153, 0.55);
}

/* 2. Corps de carte hiérarchisé (.flg-card-body) */
.flg-card-body {
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.flg-card-title {
  margin: 0 !important;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif !important;
  font-size: 16.5px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  color: var(--flg-text) !important;
  letter-spacing: -0.015em;
}

.flg-card-desc {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: var(--flg-text-soft) !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flg-card-obj {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--flg-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 3. Pied de carte : Barre de progression fine + Durée + Bouton d'accès direct */
.flg-card-foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--flg-border);
  background: var(--flg-surface-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flg-prog-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.flg-prog-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--flg-text-muted);
}
.flg-prog-labels b {
  color: var(--flg-text);
  font-family: 'JetBrains Mono', monospace;
}
.flg-prog-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.flg-prog-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b5aa8, #38bdf8);
  transition: width 0.35s ease;
}
.flg-card.st-run .flg-prog-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.flg-card.st-done .flg-prog-fill {
  background: linear-gradient(90deg, #059669, #34d399);
}

.flg-meta-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.flg-meta-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--flg-text-muted);
}
.flg-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.flg-cta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #0b5aa8, #0284c7);
  box-shadow: 0 4px 12px -3px rgba(11, 90, 168, 0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}
.flg-card.st-run .flg-cta-chip {
  background: linear-gradient(135deg, #d97706, #fa8b05);
}
.flg-card.st-done .flg-cta-chip {
  background: linear-gradient(135deg, #059669, #10b981);
}
.flg-card:hover .flg-cta-chip {
  transform: translateX(2px);
}

/* Cartes des 6 Livres du Raffinage (#blRoot .bl-shelf) */
#blRoot .bl-shelf {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 18px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. RESPONSIVE DESIGN (Desktop, Laptop, Tablette, Mobile — 0 débordement)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .flg-hero-top {
    grid-template-columns: 1fr;
  }
  .flg-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .flg-editorial-hero {
    padding: 20px 18px;
    border-radius: 20px;
  }
  .flg-search-row {
    grid-template-columns: 1fr;
  }
  .flg-status-filters {
    width: 100%;
    justify-content: space-between;
  }
  .flg-st-btn {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
  }
  .flg-cat-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .flg-cat-pill {
    flex-shrink: 0;
  }
  #v-learn .lx-cards.flg-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. ILLUSTRATIONS RÉELLES EXTRAITES DES MANUELS PDF (v6.5.0)
   ═══════════════════════════════════════════════════════════════════════════ */
.lx-real-img-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 10px 26px -14px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  box-sizing: border-box;
}
.lx-real-img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}
.lx-fig.lx-mini .lx-real-img-wrap {
  padding: 6px;
}
.lx-fig.lx-mini .lx-real-img {
  max-height: 170px;
}
.lx-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.lx-gal-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  box-shadow: 0 8px 22px -14px rgba(15, 23, 42, 0.22);
}
.lx-gal-card .lx-real-img {
  max-height: 360px;
  margin: 0 auto;
}
.lx-gal-cap {
  font-size: 12px;
  line-height: 1.42;
  color: #334155;
  font-weight: 600;
  padding: 2px 4px;
  text-align: center;
}
@media (max-width: 640px) {
  .lx-real-img-wrap { padding: 8px; }
  .lx-real-img { max-height: 380px; }
  .lx-gallery { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .flg-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .flg-kpi-val {
    font-size: 20px;
  }
  #v-learn .lx-cards.flg-cards-grid,
  #blRoot .bl-shelf {
    grid-template-columns: 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. MOUVEMENT RÉDUIT (html.rx-still) — les transitions ci-dessus portent
   !important pour s'imposer sur les styles de base ; elles doivent donc être
   neutralisées ici avec une spécificité au moins égale, sinon le coupe-circuit
   global de theme.css (html.rx-still *) ne suffit pas à les arrêter.
   ═══════════════════════════════════════════════════════════════════════════ */
html.rx-still #tabbar.tabs .tab,
html.rx-still #v-learn .lx-card.flg-card,
html.rx-still #v-learn .lx-pcard.flg-card,
html.rx-still .ap-ccard.flg-card,
html.rx-still .bl-bk.flg-card {
  transition: none !important;
}
