/* ==========================================================================
   RGPD.CLICK — DESIGN SYSTEM DES PAGES DOCUMENTAIRES STATIQUES V3.0.1
   Polices auto-hébergées, Zéro appel tiers, Rendu sans JS & Thèmes 3-États
   ========================================================================== */

/* ── POLICES LOCALES AUTO-HÉBERGÉES (ZÉRO GOOGLE FONTS NETWORK CALL) ── */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/co3ZmX5slCNuHLi8bLeY9MK7whWMhyjYrEtImSo.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/co3bmX5slCNuHLi8bLeY9MK7whWMhyjYqXtK.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 1. ÉTAT PAR DÉFAUT : THÈME SOMBRE (Signature RGPD.click) ── */
:root {
  --bg-page: #080d16;
  --bg-card: #0c1222;
  --bg-card-alt: #111a33;
  --bg-card-hover: #152244;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(245, 158, 11, 0.22);
  --border-focus: #38bdf8;
  
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.15);
  --gold-border: rgba(245, 158, 11, 0.35);
  
  --blue: #38bdf8;
  --blue-bg: rgba(56, 189, 248, 0.1);
  --blue-border: rgba(56, 189, 248, 0.25);
  
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --green-border: rgba(16, 185, 129, 0.25);
  
  --purple: #c084fc;
  --purple-bg: rgba(192, 132, 252, 0.1);
  --purple-border: rgba(192, 132, 252, 0.25);
  
  --shadow-card: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-pill: 9999px;
  
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── 2. PREFERS-COLOR-SCHEME: LIGHT (Actif seulement si pas de dark-mode explicite) ── */
@media (prefers-color-scheme: light) {
  :root:not(.dark-mode), html:not(.dark-mode) {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-alt: #f1f5f9;
    --bg-card-hover: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --border-subtle: #e2e8f0;
    --border-card: #cbd5e1;
    --border-focus: #0284c7;
    
    --gold: #92400e;
    --gold-glow: rgba(180, 83, 9, 0.08);
    --gold-border: rgba(180, 83, 9, 0.25);
    
    --blue: #075985;
    --blue-bg: rgba(2, 132, 199, 0.08);
    --blue-border: rgba(2, 132, 199, 0.25);
    
    --green: #047857;
    --green-bg: rgba(5, 150, 105, 0.08);
    --green-border: rgba(5, 150, 105, 0.25);
    
    --purple: #7e22ce;
    --purple-bg: rgba(126, 34, 206, 0.08);
    --purple-border: rgba(126, 34, 206, 0.25);
    
    --shadow-card: 0 10px 25px -3px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04);
  }
}

/* ── 3. FORÇAGE MANUEL : LIGHT-MODE ── */
:root.light-mode, html.light-mode, body.light-mode {
  --bg-page: #f8fafc !important;
  --bg-card: #ffffff !important;
  --bg-card-alt: #f1f5f9 !important;
  --bg-card-hover: #e2e8f0 !important;
  
  --text-primary: #0f172a !important;
  --text-secondary: #334155 !important;
  --text-muted: #64748b !important;
  
  --border-subtle: #e2e8f0 !important;
  --border-card: #cbd5e1 !important;
  --border-focus: #0284c7 !important;
  
  --gold: #92400e !important;
  --gold-glow: rgba(180, 83, 9, 0.08) !important;
  --gold-border: rgba(180, 83, 9, 0.25) !important;
  
  --blue: #075985 !important;
  --blue-bg: rgba(2, 132, 199, 0.08) !important;
  --blue-border: rgba(2, 132, 199, 0.25) !important;
  
  --green: #047857 !important;
  --green-bg: rgba(5, 150, 105, 0.08) !important;
  --green-border: rgba(5, 150, 105, 0.25) !important;
  
  --purple: #7e22ce !important;
  --purple-bg: rgba(126, 34, 206, 0.08) !important;
  --purple-border: rgba(126, 34, 206, 0.25) !important;
  
  --shadow-card: 0 10px 25px -3px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.04) !important;
}

/* ── 4. FORÇAGE MANUEL : DARK-MODE (Prioritaire sur OS clair) ── */
:root.dark-mode, html.dark-mode, body.dark-mode {
  --bg-page: #080d16 !important;
  --bg-card: #0c1222 !important;
  --bg-card-alt: #111a33 !important;
  --bg-card-hover: #152244 !important;
  
  --text-primary: #f8fafc !important;
  --text-secondary: #94a3b8 !important;
  --text-muted: #64748b !important;
  
  --border-subtle: rgba(255, 255, 255, 0.08) !important;
  --border-card: rgba(245, 158, 11, 0.22) !important;
  --border-focus: #38bdf8 !important;
  
  --gold: #f59e0b !important;
  --gold-glow: rgba(245, 158, 11, 0.15) !important;
  --gold-border: rgba(245, 158, 11, 0.35) !important;
  
  --blue: #38bdf8 !important;
  --blue-bg: rgba(56, 189, 248, 0.1) !important;
  --blue-border: rgba(56, 189, 248, 0.25) !important;
  
  --green: #10b981 !important;
  --green-bg: rgba(16, 185, 129, 0.1) !important;
  --green-border: rgba(16, 185, 129, 0.25) !important;
  
  --purple: #c084fc !important;
  --purple-bg: rgba(192, 132, 252, 0.1) !important;
  --purple-border: rgba(192, 132, 252, 0.25) !important;
  
  --shadow-card: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--gold);
  color: #000000;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 20px;
}

/* ── CONTENEUR PRINCIPAL CENTRÉ (~960px) ── */
.page-wrapper,
.article-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px 64px 24px;
}

@media (max-width: 680px) {
  .page-wrapper,
  .article-wrapper {
    padding: 14px 14px 48px 14px;
  }
}

/* ── HEADER NAVIGATION & DESIGN SYSTEM RGPD.CLICK ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 14px;
}

.brand-link,
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: text-shadow 0.2s ease;
}

.brand-link:hover,
.site-logo:hover {
  text-shadow: 0 0 12px var(--gold-glow);
}

.brand-accent {
  color: var(--gold);
}

.brand-domain {
  color: var(--text-primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--gold);
  background: var(--bg-card-alt);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--gold);
  font-weight: 600;
  background: var(--gold-glow);
}

.header-actions,
.theme-switch-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kb-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.kb-pill-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.theme-toggle-btn .theme-label {
  display: none;
}

@media (max-width: 680px) {
  .site-header {
    gap: 10px;
  }
  .site-nav {
    gap: 8px;
    font-size: 0.85rem;
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .header-actions,
  .theme-switch-container {
    margin-left: auto;
  }
}

/* ── FIL D'ARIANE (BREADCRUMB) ── */
.breadcrumb-nav,
.breadcrumb-container {
  margin-bottom: 22px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.breadcrumb-list,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.breadcrumb-item a {
  color: var(--blue);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item::after {
  content: "›";
  margin-left: 6px;
  color: var(--text-muted);
}

.breadcrumb-item:last-child::after {
  content: "";
  margin-left: 0;
}

.breadcrumb-item[aria-current="page"] {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── FICHE DOCUMENTAIRE (ARTICLE CARD) ── */
.legal-doc {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 680px) {
  .legal-doc {
    padding: 22px 16px;
  }
}

.doc-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.doc-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.badge-binding {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

.badge-edpb {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.badge-opinion {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.badge-draft {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}

.draft-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--gold-glow);
  border: 1px solid var(--gold-border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.55;
}

h1 {
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 10px 0;
  line-height: 1.25;
}

@media (max-width: 680px) {
  h1 {
    font-size: 1.75rem;
  }
}

.meta-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ── SECTIONS DE CONTENU JURIDIQUE ── */
.legal-section {
  margin-bottom: 32px;
}

.legal-section h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.summary-card {
  background: var(--bg-card-alt);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 1.02rem;
  color: var(--text-primary);
}

.legal-list {
  margin: 12px 0;
  padding-left: 22px;
  color: var(--text-primary);
}

.legal-list li {
  margin-bottom: 10px;
  line-height: 1.65;
}

/* ── CARTES DE SOURCES OFFICIELLES ── */
.source-item {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease;
}

.source-item:hover {
  border-color: var(--border-card);
}

.source-item .source-title {
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.source-item .source-topic {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.source-item a.official-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
}

/* ── BLOCS D'OUTILS OPÉRATIONNELS ── */
.tool-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-box:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 24px var(--gold-glow);
}

.tool-box-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.tool-box-icon {
  font-size: 1.35rem;
  line-height: 1;
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-box-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-box-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Fira Code', monospace;
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  letter-spacing: 0.02em;
}

.tool-box-title,
.tool-box strong {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
  display: block;
}

.tool-box-desc,
.tool-box p {
  margin: 0 0 16px 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.tool-box-action {
  display: flex;
  align-items: center;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: #0f172a;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 8px;
  border: 1px solid #334155;
  text-decoration: none !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tool-btn .tool-btn-arrow {
  transition: transform 0.2s ease;
  display: inline-block;
}

.tool-btn:hover {
  background: #1e293b;
  border-color: var(--gold);
  color: var(--gold) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.tool-btn:hover .tool-btn-arrow {
  transform: translateX(3px);
}

/* Thème sombre : bouton ambre lumineux à haut contraste */
:root.dark-mode .tool-btn,
:root:not(.light-mode) .tool-btn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

:root.dark-mode .tool-btn:hover,
:root:not(.light-mode) .tool-btn:hover {
  background: #f59e0b;
  color: #090d16 !important;
  border-color: #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* ── GRILLE VOIR AUSSI & INDEX DES RESSOURCES ── */
.see-also-grid,
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.see-also-card,
.resource-card {
  display: block;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.see-also-card:hover,
.resource-card:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.see-also-card .card-title,
.resource-card .card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 6px;
  line-height: 1.3;
}

.see-also-card .card-desc,
.resource-card .card-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

/* ── BOUTON RETOUR KNOWLEDGE BASE (CTA) ── */
.back-to-kb {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.btn-kb-return {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-kb-return:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--gold-glow);
}

/* ── FOOTER & METAS ── */
.doc-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-muted);
  gap: 8px;
}

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 6px 0;
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   V3.0.2 — DOCK UTILITAIRE FLOTTANT PARTAGÉ (Thème · Rangement · Lexi)
   Compact, dark/light compatible, accent or, zéro layout shift,
   actions secondaires révélées au hover/focus/tap (jamais hover-only).
   ══════════════════════════════════════════════════════════════ */
.lexi-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9990;
  display: flex;
  flex-direction: row-reverse; /* Lexi (premier enfant) à droite */
  align-items: center;
  gap: 10px;
}

.lexi-dock-btn {
  appearance: none;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 999px;
  height: 44px;
  min-width: 44px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
              border-color 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.lexi-dock-btn:hover {
  border-color: var(--gold-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.lexi-dock-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Action principale : Lexi (mini mascotte V3.0.3, ~48px, asset premier-parti) */
.lexi-dock-main {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-alt) 100%);
  border-color: var(--gold-border);
  color: var(--text-primary);
}

.lexi-dock-avatar {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex: 0 0 auto;
  pointer-events: none;
}

.lexi-dock-label {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Actions secondaires : cachées au repos, révélées sans jamais dépendre du hover seul.
   V3.0.2 : opacity+pointer-events (et non visibility) → les boutons restent dans
   l'ordre de tabulation clavier, ce qui permet à :focus-within de les révéler. */
.lexi-dock-secondary {
  display: flex;
  gap: 8px;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, pointer-events 0s linear 0.2s;
}

.lexi-dock.is-open .lexi-dock-secondary,
.lexi-dock:hover .lexi-dock-secondary,
.lexi-dock:focus-within .lexi-dock-secondary {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0s;
}

/* Panneau Lexi embarqué */
.lexi-dock-panel {
  position: fixed;
  right: 18px;
  bottom: 74px;
  width: min(380px, calc(100vw - 36px));
  max-height: min(520px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  z-index: 9991;
}

.lexi-dock-panel.is-open {
  display: flex;
}

.lexi-dock-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 0.92rem;
}

.lexi-dock-head .lexi-page-title {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lexi-dock-msgs {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.86rem;
  line-height: 1.5;
}

.lexi-dock-msg {
  padding: 9px 12px;
  border-radius: 10px;
  max-width: 92%;
}

.lexi-dock-msg.user {
  align-self: flex-end;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-card);
}

.lexi-dock-msg.ai {
  align-self: flex-start;
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
}

.lexi-dock-msg p,
.lexi-dock-msg ul,
.lexi-dock-msg ol,
.lexi-dock-msg .lexi-heading {
  margin: 0 0 0.55rem;
}

.lexi-dock-msg > :last-child {
  margin-bottom: 0;
}

.lexi-dock-msg .lexi-heading {
  color: var(--gold);
  font-size: 0.92rem;
}

.lexi-dock-msg ul,
.lexi-dock-msg ol {
  padding-left: 1.15rem;
}

.lexi-dock-consent {
  max-width: 100%;
}

.lexi-dock-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.lexi-dock-consent-actions .lexi-dock-btn {
  width: auto;
  height: auto;
  padding: 9px 12px;
}

.lexi-dock-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-subtle);
}

.lexi-dock-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  border-radius: 9px;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 0.85rem;
}

.lexi-dock-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold-border);
}

.lexi-dock-send {
  appearance: none;
  border: 1px solid var(--gold-border);
  background: var(--gold-glow);
  color: var(--text-primary);
  border-radius: 9px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.lexi-dock-send:disabled {
  opacity: 0.5;
  cursor: wait;
}

.lexi-dock-send:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.lexi-dock-note {
  padding: 0 14px 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 480px) {
  .lexi-dock { right: 12px; bottom: 12px; }
  .lexi-dock-panel { right: 12px; bottom: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .lexi-dock-btn,
  .lexi-dock-secondary,
  .lexi-dock-panel {
    transition: none !important;
  }
}


/* ── SÉLECTEUR DE LANGUE COMPACT (DOCS / PERMANENT PAGES) ── */
.lang-selector-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.lang-btn:hover {
  border-color: var(--gold-border);
  background: var(--gold-glow);
  transform: translateY(-1px);
}

.lang-btn .flag-icon {
  width: 20px;
  height: auto;
  border-radius: 2px;
  display: block;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  transform: translateY(-6px);
  min-width: 170px;
}

.lang-menu.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-option:hover {
  background: var(--bg-card-hover);
  transform: scale(1.15);
}

.lang-option .flag-icon {
  width: 22px;
  height: auto;
  border-radius: 2px;
  display: block;
}
