* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Sora', 'Segoe UI', system-ui, sans-serif;
  background: #0f1117;
  color: #e6e6e6;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0a0c12;
}

::-webkit-scrollbar-thumb {
  background: #3a4152;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #7c5cff;
}

html {
  scrollbar-color: #3a4152 #0a0c12;
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  border-bottom: 1px solid #1f2430;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(90deg, #8b5cf6, #b39dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
}

.docs-tag {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b39dff;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  -webkit-text-fill-color: #b39dff;
}

.nav-links a {
  color: #b7bdcc;
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

.nav-cta {
  background: #7c5cff;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0.55rem 1.2rem;
  border-radius: 100px;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.nav-cta:hover {
  background: #8b5cf6;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(124, 92, 255, 0.5);
}

.docs-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 5% 5rem;
  gap: 3rem;
  align-items: flex-start;
}

.docs-sidebar {
  position: sticky;
  top: 2rem;
  width: 200px;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 1rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 0.7rem;
}

.sidebar-list a {
  color: #b7bdcc;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.sidebar-list a:hover {
  color: #b39dff;
}

.toc-sub a {
  padding-left: 1rem;
  font-size: 0.85rem;
}

.toc-list a.active {
  color: #b39dff;
  font-weight: 600;
}

.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
}

/* ==========================================================================
   Hero de la doc
   ========================================================================== */
.doc-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #1f2430;
}

.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.25);
  color: #b39dff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.1rem;
}

.doc-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.7rem;
}

.doc-hero h1 span {
  color: #b39dff;
}

.doc-hero .sub {
  color: #b7bdcc;
  font-size: 1rem;
  max-width: 560px;
  margin-bottom: 1.3rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.meta-item span {
  color: #b7bdcc;
}

/* ==========================================================================
   Typographie du contenu
   ========================================================================== */
.docs-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.8rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  scroll-margin-top: 90px;
}

.docs-content h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #7c5cff, #b39dff);
  border-radius: 2px;
  flex-shrink: 0;
}

.docs-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #b7bdcc;
  margin: 1.6rem 0 0.6rem;
  scroll-margin-top: 90px;
}

.docs-content p {
  color: #b7bdcc;
  font-size: 0.94rem;
  margin-bottom: 0.85rem;
}

.docs-content ul {
  margin: 0.5rem 0 1rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.docs-content ul li {
  color: #b7bdcc;
  font-size: 0.92rem;
}

.docs-content ul li::marker {
  color: #7c5cff;
}

.docs-content hr {
  border: none;
  border-top: 1px solid #1f2430;
  margin: 2.2rem 0;
}

code {
  font-family: 'JetBrains Mono', monospace;
  background: #171b26;
  border: 1px solid #232838;
  color: #b39dff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

/* ==========================================================================
   Blocs de code
   ========================================================================== */
.code-block {
  position: relative;
  background: #0a0c12;
  border: 1px solid #232838;
  border-radius: 12px;
  margin: 0.7rem 0 1.4rem;
  overflow: hidden;
}

.cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid #1f2430;
}

.cb-lang {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(124, 92, 255, 0.1);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: #b39dff;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Sora', sans-serif;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.copy-btn:hover {
  background: rgba(124, 92, 255, 0.2);
  border-color: rgba(124, 92, 255, 0.5);
}

.copy-btn.copied {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}

.code-block pre {
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.81rem;
  line-height: 1.75;
  color: #e2e8f0;
}

.cm {
  color: #4a5568;
  font-style: italic;
}

/* ==========================================================================
   Tableaux
   ========================================================================== */
.tw {
  overflow-x: auto;
  margin: 0.7rem 0 1.4rem;
  border-radius: 10px;
  border: 1px solid #232838;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.docs-content thead th {
  padding: 0.7rem 1rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  color: #6b7280;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid #232838;
  white-space: nowrap;
}

.docs-content tbody tr {
  border-bottom: 1px solid #1f2430;
  transition: background 0.15s;
}

.docs-content tbody tr:last-child {
  border-bottom: none;
}

.docs-content tbody tr:hover {
  background: rgba(124, 92, 255, 0.04);
}

.docs-content tbody td {
  padding: 0.65rem 1rem;
  color: #b7bdcc;
}

.docs-content tbody td.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #b39dff;
}

/* ==========================================================================
   Callouts (info / warn / ok)
   ========================================================================== */
.box {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  margin: 0.7rem 0 1.3rem;
  font-size: 0.86rem;
}

.box-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.box-text {
  color: #b7bdcc;
  line-height: 1.6;
}

.box.info {
  background: rgba(124, 92, 255, 0.07);
  border: 1px solid rgba(124, 92, 255, 0.2);
}

.box.warn {
  background: rgba(220, 50, 50, 0.06);
  border: 1px solid rgba(220, 50, 50, 0.18);
}

.box.ok {
  background: rgba(74, 222, 128, 0.06);
  border: 1px solid rgba(74, 222, 128, 0.18);
}

.doc-footer {
  margin-top: 3.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid #1f2430;
  text-align: center;
  color: #6b7280;
  font-size: 0.8rem;
}

.faq-item {
  background: #171b26;
  border: 1px solid #232838;
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
}

.faq-q {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.4rem;
}

.faq-a {
  color: #b7bdcc;
  margin-bottom: 0;
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
  padding: 0.9rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-block;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.btn-primary {
  background: #7c5cff;
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(124, 92, 255, 0.65);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid #3a4152;
}

.btn-secondary:hover {
  background: #1a1f2e;
  border-color: #7c5cff;
}

/* ==========================================================================
   Page 404
   ========================================================================== */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 5%;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  background: linear-gradient(90deg, #8b5cf6, #b39dff, #8b5cf6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
  line-height: 1;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.error-title {
  font-size: 1.6rem;
  margin: 1rem 0 0.5rem;
}

.error-text {
  color: #b7bdcc;
  max-width: 480px;
  margin-bottom: 2rem;
}

/* ==========================================================================
   Responsive — tablette et mobile (en dernier pour surcharger les règles précédentes)
   ========================================================================== */
/* Bouton du sommaire repliable : caché sur desktop (le sommaire est collé à gauche) */
.toc-toggle {
  display: none;
}

@media (max-width: 800px) {
  /* Colonne unique : "stretch" évite que le contenu (tableaux, code) élargisse la page */
  .docs-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    padding: 1.5rem 5% 3rem;
  }

  .docs-content {
    width: 100%;
    max-width: 100%;
  }

  /* Sommaire replié par défaut, déplié via le bouton */
  .docs-sidebar {
    position: static;
    width: 100%;
    background: #171b26;
    border: 1px solid #232838;
    border-radius: 12px;
  }

  .sidebar-title {
    display: none;
  }

  .toc-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1.1rem;
    background: transparent;
    border: 0;
    color: #e6e6e6;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
  }

  .toc-toggle svg {
    transition: transform 0.2s ease;
  }

  .toc-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  .sidebar-list {
    display: none;
    padding: 0 1.1rem 0.8rem;
    max-height: 60vh;
    overflow-y: auto;
  }

  .docs-sidebar.open .sidebar-list {
    display: block;
  }

  .sidebar-list li {
    margin-bottom: 0;
  }

  .sidebar-list a {
    display: block;
    padding: 0.5rem 0;
  }

  .toc-sub a {
    padding-left: 1rem;
  }

  /* Navbar plus compacte */
  .navbar {
    padding: 1rem 5%;
  }

  .logo {
    font-size: 1.15rem;
  }

  .nav-cta {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  /* Contenu */
  .doc-hero h1 {
    font-size: 1.9rem;
  }

  .docs-content h2 {
    font-size: 1.25rem;
    margin-top: 2.2rem;
  }

  /* Tableaux : les cellules passent à la ligne au lieu de forcer un scroll horizontal */
  .docs-content thead th {
    white-space: normal;
    padding: 0.6rem 0.75rem;
  }

  .docs-content tbody td {
    padding: 0.6rem 0.75rem;
  }

  .docs-content tbody td.mono {
    overflow-wrap: anywhere;
  }

  .code-block pre {
    padding: 0.9rem 1rem;
    font-size: 0.78rem;
  }

  /* Footer : boutons empilés pleine largeur */
  /* 404 */
  .error-page {
    min-height: 60vh;
    padding: 3rem 5%;
  }

  .error-code {
    font-size: 4.5rem;
  }
}

@media (hover: none) {
  .btn:hover,
  .nav-cta:hover {
    transform: none;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #0a0c12;
  border-top: 1px solid #1f2430;
  padding: 3.5rem 5% 1.6rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1f2430;
}

.footer-desc {
  color: #8b93a7;
  font-size: 0.9rem;
  max-width: 300px;
  margin-top: 0.9rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e6e6e6;
  margin-bottom: 0.4rem;
}

.footer-col a {
  width: fit-content;
  color: #8b93a7;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #b39dff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  padding-top: 1.4rem;
}

.copyright,
.footer-note {
  color: #6b7280;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 1.5rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .footer {
    padding: 2.5rem 5% 1.4rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem 1.2rem;
    padding-bottom: 2rem;
  }

  .footer-col:last-of-type {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Emojis Discord : teinte violette uniforme */
img.emoji-custom, img.emoji-anim, img.emoji-inline { filter: brightness(0) saturate(100%) invert(36%) sepia(88%) saturate(3300%) hue-rotate(238deg) brightness(100%) contrast(101%); }

/* ==========================================================================
   THEME COSMIQUE — identique au site principal (violet nuit étoilée)
   Bloc en fin de fichier : il surcharge les couleurs sans toucher au responsive.
   ========================================================================== */
:root {
  --space-0: #07051a; --space-1: #0d0a28; --space-2: #15103a;
  --glass-border: rgba(150, 130, 255, 0.18);
  --glow: #7c6cff; --glow-soft: #a99bff;
  --star-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='40' cy='80' r='1' opacity='.7'/%3E%3Ccircle cx='160' cy='300' r='.8' opacity='.5'/%3E%3Ccircle cx='260' cy='40' r='1.2' opacity='.8'/%3E%3Ccircle cx='340' cy='220' r='.7' opacity='.45'/%3E%3Ccircle cx='430' cy='120' r='1' opacity='.65'/%3E%3Ccircle cx='520' cy='360' r='1.1' opacity='.7'/%3E%3Ccircle cx='90' cy='460' r='.9' opacity='.55'/%3E%3Ccircle cx='300' cy='520' r='1' opacity='.6'/%3E%3Ccircle cx='470' cy='540' r='.7' opacity='.4'/%3E%3Ccircle cx='570' cy='60' r='.8' opacity='.5'/%3E%3C/g%3E%3C/svg%3E");
}
html { scrollbar-color: #3b2f8a #07051a; }
::-webkit-scrollbar-track { background: #07051a; }
::-webkit-scrollbar-thumb { background: #3b2f8a; }
::-webkit-scrollbar-thumb:hover { background: #7c6cff; }

body {
  background-color: var(--space-0);
  background-image:
    radial-gradient(900px 600px at 85% 6%, rgba(124, 108, 255, 0.16), transparent 70%),
    radial-gradient(800px 700px at 5% 50%, rgba(100, 70, 220, 0.12), transparent 70%),
    radial-gradient(900px 600px at 70% 95%, rgba(124, 108, 255, 0.1), transparent 70%),
    linear-gradient(180deg, var(--space-1) 0%, var(--space-0) 100%);
  background-attachment: fixed;
  color: #e8e6f7;
}
#starfield { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body > nav, body > div, body > footer { position: relative; z-index: 1; }
body > nav.navbar { z-index: 20; }

.navbar {
  background: rgba(10, 7, 32, 0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.docs-tag { border-radius: 999px; }
.nav-cta {
  background: linear-gradient(135deg, #7c6cff, #5b46e8);
  box-shadow: 0 4px 22px rgba(124, 108, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative; overflow: hidden;
}
.nav-cta { display: inline-block; isolation: isolate; overflow: hidden; }
.nav-cta:hover { background: linear-gradient(135deg, #8b7bff, #6a55f0); box-shadow: 0 8px 30px rgba(124, 108, 255, 0.7); }
.nav-cta::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); animation: sheen 4.5s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { left: -60%; } 100% { left: 140%; } }

.doc-hero { border-bottom-color: var(--glass-border); }
.doc-hero h1 span { background: linear-gradient(90deg, #a99bff, #f1edff, #a99bff); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 5s linear infinite; }
@keyframes shimmer { 0% { background-position: 0% center; } 100% { background-position: 200% center; } }
.doc-hero .sub { color: #c9c4ea; }
.doc-badge { background: rgba(124, 108, 255, 0.14); border-color: rgba(169, 155, 255, 0.3); color: var(--glow-soft); }

code { background: rgba(124, 108, 255, 0.12); border-color: var(--glass-border); color: var(--glow-soft); border-radius: 8px; }
.code-block {
  background: linear-gradient(160deg, rgba(20, 14, 52, 0.85), rgba(10, 7, 32, 0.85));
  border-color: var(--glass-border); border-radius: 18px;
}
.cb-header { border-bottom-color: var(--glass-border); }
.box { border-radius: 16px; backdrop-filter: blur(6px); }
.box.info { background: rgba(124, 108, 255, 0.1); border-color: rgba(169, 155, 255, 0.3); }
.box-text { color: #c4bfe6; }
.faq-item {
  background: linear-gradient(160deg, rgba(34, 25, 84, 0.55), rgba(17, 12, 46, 0.55));
  border-color: var(--glass-border); border-radius: 18px;
}
.doc-footer { border-top-color: var(--glass-border); }
.btn { border-radius: 999px; }
.btn-primary { background: linear-gradient(135deg, #7c6cff, #5b46e8); box-shadow: 0 4px 22px rgba(124, 108, 255, 0.45); }
.btn-secondary { background: rgba(21, 16, 58, 0.45); border-color: var(--glass-border); }

.docs-sidebar .sidebar-list a { border-radius: 10px; }
.docs-content h2 { color: #fff; }
.toc-toggle { background: rgba(21, 16, 58, 0.75); border-color: var(--glass-border); border-radius: 14px; }

/* tableaux */
table { border-collapse: separate; border-spacing: 0; }
th, td { border-color: var(--glass-border) !important; }
th { background: rgba(124, 108, 255, 0.1); }

.footer {
  background: linear-gradient(180deg, rgba(13, 10, 40, 0.7), var(--space-0));
  border-top: 1px solid var(--glass-border);
  border-radius: 36px 36px 0 0;
}
.footer-col a:hover { color: var(--glow-soft); }
@media (prefers-reduced-motion: reduce) { .nav-cta::after, .doc-hero h1 span { animation: none; } }

/* ==========================================================================
   ECRAN DE CHARGEMENT
   Masqué par js/script.js une fois la page chargée ; s'efface seul après 5 s
   si le script ne répond pas.
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem;
  background: radial-gradient(700px 500px at 50% 45%, rgba(124, 108, 255, 0.2), transparent 70%), linear-gradient(180deg, #0d0a28, #07051a);
  transition: opacity 0.6s ease, visibility 0.6s ease;
  animation: loaderFailsafe 0.6s ease 5s forwards;
}
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes loaderFailsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.loader-orb { position: relative; width: 96px; height: 96px; }
.loader-orb img {
  width: 100%; height: 100%; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(169, 155, 255, 0.35), 0 0 40px rgba(124, 108, 255, 0.6), 0 0 90px rgba(124, 108, 255, 0.35);
  animation: loaderPulse 1.8s ease-in-out infinite;
}
.loader-orb::before, .loader-orb::after { content: ""; position: absolute; border-radius: 50%; }
.loader-orb::before {
  inset: -14px; border: 2px solid rgba(169, 155, 255, 0.15); border-top-color: #e9e4ff; border-right-color: rgba(169, 155, 255, 0.6);
  animation: loaderSpin 1.1s linear infinite;
}
.loader-orb::after {
  inset: -28px; border: 1px solid rgba(169, 155, 255, 0.1); border-bottom-color: rgba(169, 155, 255, 0.55);
  animation: loaderSpin 2.2s linear infinite reverse;
}
.loader-name {
  font-family: 'Sora', system-ui, sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: 0.04em;
  background: linear-gradient(90deg, #a99bff, #f1edff, #a99bff); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: loaderShimmer 2.4s linear infinite;
}
.loader-bar { width: 160px; height: 4px; border-radius: 999px; background: rgba(169, 155, 255, 0.15); overflow: hidden; }
.loader-bar span {
  display: block; width: 40%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, #a99bff, #7c6cff);
  animation: loaderSlide 1.3s ease-in-out infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes loaderShimmer { to { background-position: 200% center; } }
@keyframes loaderSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .loader-orb img, .loader-orb::before, .loader-orb::after, .loader-name, .loader-bar span { animation: none; } }

/* ==========================================================================
   PAGE 404 — la page s'est perdue dans l'espace
   ========================================================================== */
.error-page { position: relative; z-index: 1; }
.lost {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-size: clamp(5rem, 22vw, 10rem); font-weight: 800; line-height: 1;
}
.lost > span:not(.lost-orb) {
  background: linear-gradient(180deg, #f1edff, #7c6cff); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(124, 108, 255, 0.4);
}
.lost-orb { width: 0.85em; height: 0.85em; display: inline-block; animation: lostDrift 7s ease-in-out infinite; }
.lost-orb img {
  width: 100%; height: 100%; border-radius: 50%; display: block;
  box-shadow: 0 0 0 1px rgba(169, 155, 255, 0.35), 0 0 40px rgba(124, 108, 255, 0.6), 0 0 90px rgba(124, 108, 255, 0.3);
  animation: lostSpin 12s linear infinite;
}
@keyframes lostDrift {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(14px, -18px) rotate(6deg); }
  50% { transform: translate(-6px, -8px) rotate(12deg); }
  75% { transform: translate(-16px, -20px) rotate(-4deg); }
}
@keyframes lostSpin { to { transform: rotate(360deg); } }
.error-joke { margin: 0.4rem auto 1.8rem; max-width: 520px; font-size: 0.85rem; color: #8f88bd; font-style: italic; }
@media (prefers-reduced-motion: reduce) { .lost-orb, .lost-orb img { animation: none; } }

/* ==========================================================================
   Menu burger (mobile) : le lien « Site principal » et le sélecteur FR | EN
   passent dans un menu déroulant
   ========================================================================== */
.nav-toggle { display: none; }
.navbar .nav-links { display: flex; align-items: center; gap: 0.6rem; }

@media (max-width: 700px) {
  body > nav.navbar { position: sticky; top: 0; flex-wrap: wrap; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    width: 2.7rem; height: 2.7rem; margin-left: auto;
    background: rgba(21, 16, 58, 0.75); border: 1px solid var(--glass-border); border-radius: 16px;
    cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
  }
  .nav-toggle:hover, .nav-toggle:focus-visible { border-color: #7c6cff; outline: none; }
  .nav-toggle span { display: block; width: 1.15rem; height: 2px; background: #e8e6f7; border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .navbar .nav-links {
    display: none; flex-direction: column; align-items: stretch; gap: 0.7rem;
    position: absolute; top: calc(100% + 0.4rem); left: 5%; right: 5%;
    padding: 1rem; border-radius: 20px;
    background: rgba(13, 10, 40, 0.96); border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .navbar .nav-links.open { display: flex; animation: navDrop 0.22s ease; }
  .navbar .nav-cta { text-align: center; padding: 0.75rem 1rem; font-size: 0.92rem; }
  .navbar .nav-links .lang-switch { align-self: center; margin: 0; }
  .navbar .nav-links .lang-switch button { padding: 0.5rem 1rem; font-size: 0.78rem; }
}
@keyframes navDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Recherche dans la documentation (Ctrl+K)
   ========================================================================== */
.ds-btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: rgba(21, 16, 58, 0.75); border: 1px solid var(--glass-border); color: #cfc6ff; font: 600 0.85rem 'Sora', system-ui, sans-serif; cursor: pointer; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.ds-btn:hover, .ds-btn:focus-visible { border-color: #a99bff; color: #fff; outline: none; background: rgba(124, 108, 255, 0.16); }
.ds-btn kbd { font: 700 0.64rem 'JetBrains Mono', monospace; padding: 0.15rem 0.4rem; border-radius: 6px; background: rgba(124, 108, 255, 0.2); color: #cfc6ff; }
.ds-modal { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; background: rgba(7, 5, 26, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ds-modal[hidden] { display: none; }
.ds-box { width: 100%; max-width: 620px; border-radius: 22px; background: linear-gradient(170deg, rgba(34, 27, 84, 0.97), rgba(13, 10, 40, 0.98)); border: 1px solid rgba(169, 155, 255, 0.35); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(124, 108, 255, 0.2); overflow: hidden; }
.ds-input { width: 100%; padding: 1.15rem 1.4rem; background: transparent; border: 0; border-bottom: 1px solid rgba(150, 130, 255, 0.2); color: #fff; font: 600 1.05rem 'Sora', system-ui, sans-serif; outline: none; }
.ds-input::placeholder { color: #8f88bd; }
.ds-list { list-style: none; max-height: 52vh; overflow-y: auto; padding: 0.5rem; }
.ds-item { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.9rem; border-radius: 12px; cursor: pointer; }
.ds-item.on, .ds-item:hover { background: rgba(124, 108, 255, 0.2); }
.ds-t { font-weight: 700; color: #fff; font-size: 0.93rem; }
.ds-t.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: #cfc6ff; }
.ds-d { font-size: 0.8rem; color: #b7b0dc; line-height: 1.45; }
.ds-empty { padding: 1.4rem; text-align: center; color: #b7b0dc; font-size: 0.9rem; }
body.ds-open { overflow: hidden; }
@media (max-width: 700px) {
  .navbar .nav-links .ds-btn { justify-content: center; padding: 0.7rem 1rem; }
  .ds-btn kbd { display: none; }
  .ds-modal { padding-top: 6vh; }
}

/* ==========================================================================
   Refonte : une page par module (menu des modules, cartes d'accueil, pagination)
   ========================================================================== */
.docs-sidebar { max-height: calc(100vh - 4rem); overflow-y: auto; scrollbar-width: thin; padding-right: 0.5rem; }
.docs-sidebar .sidebar-title { margin: 0 0 0.8rem; }
.docs-sidebar .toc-list { margin-bottom: 0; }
.mod-list { margin-bottom: 1.6rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--glass-border); }
.mod-list li { margin-bottom: 0.35rem; }
.mod-list a { display: block; padding: 0.42rem 0.7rem; margin-left: -0.7rem; border-radius: 10px; }
.mod-list a:hover { background: rgba(124, 92, 255, 0.1); }
.mod-list a.cur { color: #fff; font-weight: 700; background: linear-gradient(135deg, rgba(124, 92, 255, 0.28), rgba(139, 92, 246, 0.12)); box-shadow: inset 2px 0 0 #b39dff; }

.doc-hero-mod h1 { font-size: 2.1rem; }
.doc-hero-mod { margin-bottom: 2rem; padding-bottom: 1.6rem; }

.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0 0.5rem; }
.mod-card { position: relative; display: flex; flex-direction: column; gap: 0.45rem; padding: 1.2rem 3rem 1.2rem 1.3rem; border-radius: 16px; background: linear-gradient(160deg, rgba(34, 25, 84, 0.5), rgba(17, 12, 46, 0.5)); border: 1px solid var(--glass-border); text-decoration: none; transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s; }
.mod-card:hover { border-color: rgba(169, 155, 255, 0.55); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(10, 6, 40, 0.5); }
.mod-name { font-weight: 800; font-size: 1.08rem; color: #fff; }
.mod-desc { font-size: 0.9rem; line-height: 1.55; color: #b7bdcc; }
.mod-go { position: absolute; right: 1.2rem; top: 1.2rem; color: #a99bff; font-size: 1.2rem; transition: transform 0.2s; }
.mod-card:hover .mod-go { transform: translateX(4px); color: #fff; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 3rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--glass-border); }
.pager a { display: flex; flex-direction: column; gap: 0.2rem; max-width: 48%; padding: 0.9rem 1.2rem; border-radius: 14px; background: rgba(21, 16, 58, 0.6); border: 1px solid var(--glass-border); text-decoration: none; transition: border-color 0.2s, transform 0.2s; }
.pager a:hover { border-color: rgba(169, 155, 255, 0.55); transform: translateY(-2px); }
.pager .pg-next { margin-left: auto; text-align: right; }
.pg-dir { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8a90a6; }
.pg-name { font-weight: 700; color: #fff; }

.ds-item .ds-pg { margin-left: 0.5rem; font-size: 0.7rem; color: #8a90a6; font-weight: 600; }

@media (max-width: 800px) {
  .docs-sidebar { max-height: none; overflow: visible; padding-right: 0; }
  .sidebar-body { display: none; padding: 0 1.1rem 0.8rem; max-height: 65vh; overflow-y: auto; }
  .docs-sidebar.open .sidebar-body { display: block; }
  .docs-sidebar .sidebar-list { display: block; padding: 0; max-height: none; overflow: visible; }
  .docs-sidebar .sidebar-title { display: block; margin-top: 0.4rem; }
  .mod-list a { margin-left: 0; }
  .mod-grid { grid-template-columns: 1fr; }
  .pager a { max-width: 100%; }
  .pager { flex-direction: column; }
  .pager .pg-next { margin-left: 0; text-align: left; }
  .doc-hero-mod h1 { font-size: 1.7rem; }
}

/* Barre de défilement du menu de gauche : fine, arrondie, sans flèches */
.docs-sidebar { scrollbar-width: thin; scrollbar-color: rgba(124, 92, 255, 0.4) transparent; }
.docs-sidebar::-webkit-scrollbar { width: 6px; height: 6px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(124, 92, 255, 0.4); border-radius: 999px; }
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(179, 157, 255, 0.7); }
.docs-sidebar::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* ==========================================================================
   Commandes en cartes (avec bouton « copier »)
   ========================================================================== */
.cmd-list { display: grid; gap: 0.7rem; margin: 1.1rem 0 1.4rem; }
.cmd { padding: 0.85rem 1rem 0.95rem; border-radius: 14px; background: linear-gradient(160deg, rgba(34, 25, 84, 0.45), rgba(17, 12, 46, 0.45)); border: 1px solid var(--glass-border); transition: border-color 0.2s, background 0.2s; }
.cmd:hover { border-color: rgba(169, 155, 255, 0.45); }
.cmd-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.55rem; }
.cmd-top code.mono { display: inline-block; max-width: 100%; padding: 0.3rem 0.7rem; border-radius: 8px; background: rgba(7, 5, 26, 0.7); border: 1px solid rgba(124, 92, 255, 0.28); color: #cfc6ff; font-family: 'JetBrains Mono', monospace; font-size: 0.84rem; line-height: 1.5; overflow-wrap: anywhere; white-space: normal; }
.cmd-copy { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 8px; background: rgba(124, 92, 255, 0.1); border: 1px solid rgba(124, 92, 255, 0.3); color: #b39dff; cursor: pointer; transition: all 0.2s; }
.cmd-copy:hover { background: rgba(124, 92, 255, 0.22); border-color: rgba(124, 92, 255, 0.55); color: #fff; }
.cmd-copy.copied { color: #4ade80; border-color: rgba(74, 222, 128, 0.45); background: rgba(74, 222, 128, 0.1); }
.cmd-desc { margin: 0; font-size: 0.92rem; line-height: 1.6; color: #c4bee6; }
.cmd-desc code { font-size: 0.85em; }
@media (max-width: 800px) { .cmd { padding: 0.8rem 0.85rem; } }

/* Pastille de permission sur les cartes de commandes */
.cmd-top .cmd-perm { margin-left: auto; align-self: center; flex-shrink: 0; padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; color: #ffd9a0; background: rgba(255, 176, 64, 0.12); border: 1px solid rgba(255, 176, 64, 0.35); }
@media (max-width: 800px) { .cmd-top { flex-wrap: wrap; } .cmd-top .cmd-perm { margin-left: 0; order: 3; } .cmd-top .cmd-copy { margin-left: auto; } }

/* Menu de gauche : l'élément actif n'est plus coupé sur le bord (marge négative retirée, retrait ajouté au reste) */
.mod-list a { margin-left: 0; border-radius: 12px; }
.mod-list a.cur { box-shadow: none; }
@media (min-width: 801px) {
  .docs-sidebar { padding-left: 0.3rem; }
  .docs-sidebar .sidebar-title, .docs-sidebar .toc-list { padding-left: 0.7rem; }
}
.cmd-top .cmd-perm.all { color: #b8f5cf; background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.35); }
.footer-host { margin: 0.7rem 0 0; color: #8b86b5; font-size: 0.82rem; }
.footer-host a { color: #b39dff; font-weight: 700; text-decoration: none; }
.footer-host a:hover { text-decoration: underline; }
