/* WEVIA TRAINING CSS BUNDLE D820+B25 - 2026-05-13 */
/* 8 CSS consolides. d700 + weval-master-theme retires (nginx sub_filter D825 les injecte automatiquement) */
/*--- d495-wcag-systemic ---*/
/*
 * D496 v2 - Fix systémique anti contraste blanc/blanc et noir/noir
 * Yacine: "TEST PLAYWRIGHT OBLIGATOIRE CA NE MARCHE PAS"
 *
 * v2 fixes:
 * - HTML root force dark si body data-theme=dark (ou class dark-theme)
 * - .pill autorun-status force contrast
 * - .tab text force contrast AAA
 * - .brand-sub force visible
 * - tab on cream bg (faf8f5) get dark text
 */

/* === V2 D496: HTML root inherit body dark theme === */
html:has(body[data-theme="dark"]),
html:has(body.dark-theme) {
  background: var(--weval-bg-dark, #0B0D14) !important;
}

/* === Force visible on transparent bgs sur dark theme === */
body[data-theme="dark"] *,
body.dark-theme * {
  /* éléments avec bg transparent -> font sur dark, doit être lisible */
}

/* Fix .pill on dark theme - force readable color */
body[data-theme="dark"] .pill,
body.dark-theme .pill,
body[data-theme="dark"] #autorun-status,
body.dark-theme #autorun-status {
  color: #e2e8f0 !important;
  background-color: rgba(108, 158, 248, 0.15) !important;
  border: 1px solid rgba(108, 158, 248, 0.3) !important;
}

/* Tabs on dark theme */
body[data-theme="dark"] .tab,
body.dark-theme .tab {
  color: #c8d1e0 !important;  /* AAA contrast ratio 9:1 */
}
body[data-theme="dark"] .tab.active,
body.dark-theme .tab.active {
  color: #ffffff !important;  /* Maximum contrast for active */
}

/* Brand sub */
body[data-theme="dark"] .brand-sub,
body.dark-theme .brand-sub {
  color: #c8d1e0 !important;
}

/* btn-primary on dark - contraste fond + texte */
body[data-theme="dark"] .btn-primary,
body.dark-theme .btn-primary {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4f46e5 !important;
}

/* === V1 (préservé) - cas critiques génériques === */

/* 1. Plein écran F11 - background explicite */
:fullscreen,
:-webkit-full-screen,
:-moz-full-screen {
  background: var(--bg, #0a0e1a) !important;
}

::backdrop {
  background-color: rgba(0,0,0,0.85) !important;
}

/* 2-3. Anti white-on-white + black-on-black */
[style*="color:#fff"][style*="background:#fff"],
[style*="color:#FFF"][style*="background:#FFF"],
[style*="color:white"][style*="background:white"] {
  color: #000 !important;
}

[style*="color:#000"][style*="background:#000"],
[style*="color:black"][style*="background:black"] {
  color: #fff !important;
}

/* 4. Inputs/textarea/select - toujours contrasté */
body[data-theme="dark"] input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body.dark-theme input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.dark-theme textarea,
body.dark-theme select {
  background-color: rgba(15, 23, 42, 0.8) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
}

/* 5. Liens visibles */
a:not(.btn):not(.tab):not([class]) {
  color: #6c9ef8;
  text-decoration: underline;
}

/* 6. Focus visible WCAG */
*:focus-visible {
  outline: 2px solid #6c9ef8 !important;
  outline-offset: 2px !important;
}

/* 8. Dark mode auto */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e1a;
    --fg: #e8ecf1;
  }
}

/* 9. Scrollbar visible en dark */
body[data-theme="dark"] ::-webkit-scrollbar,
body.dark-theme ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
body[data-theme="dark"] ::-webkit-scrollbar-track,
body.dark-theme ::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
}
body[data-theme="dark"] ::-webkit-scrollbar-thumb,
body.dark-theme ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 6px;
}

/* 10. Empty buttons min-size */
[role="button"]:empty,
button:empty {
  min-width: 24px;
  min-height: 24px;
}

/* === V2 D496: Logout button (top right) lisibility === */
body[data-theme="dark"] [onclick*="logout"],
body[data-theme="dark"] [href*="logout"],
body[data-theme="dark"] .logout,
body.dark-theme [onclick*="logout"],
body.dark-theme [href*="logout"],
body.dark-theme .logout {
  color: #e2e8f0 !important;
  background-color: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
}
/*--- d507-contrast-systemic ---*/
/* =====================================================================
   D507 v2 — CONTRAST SYSTEMIC FIX (Doctrine 6 STRIKE RULE)
   Loaded GLOBALLY via nginx sub_filter, AFTER weval-master-theme.css
   Targets: black-on-black + cream-on-cream recurrent patterns
   ===================================================================== */

/* === PATTERN 1: Hero sections avec dark gradients (.hero) === */
.hero[style*="linear-gradient"][style*="0f172a"] *,
.hero[style*="linear-gradient"][style*="1e1b4b"] *,
.hero[style*="linear-gradient"][style*="0a0d14"] *,
.hero[style*="linear-gradient"][style*="1e40af"] *,
section.hero[style*="linear-gradient"] h1,
section.hero[style*="linear-gradient"] h2,
section.hero[style*="linear-gradient"] h3 {
    color: #fff !important;
}
.hero[style*="linear-gradient"][style*="0f172a"] p,
.hero[style*="linear-gradient"][style*="1e1b4b"] p,
.hero[style*="linear-gradient"][style*="1e40af"] p {
    color: #cbd5e1 !important; /* WCAG AA on dark navy */
}

/* === PATTERN 2: Inline-style dark backgrounds → light text descendants === */
[style*="background:#0a0d14"] :not(button):not(input):not([style*="color"]),
[style*="background:#0e1219"] :not(button):not(input):not([style*="color"]),
[style*="background:#1a1f2d"] :not(button):not(input):not([style*="color"]),
[style*="background:#0f172a"] :not(button):not(input):not([style*="color"]),
[style*="background:#12131A"] :not(button):not(input):not([style*="color"]),
[style*="background:#1e1b4b"] :not(button):not(input):not([style*="color"]),
[style*="background:#3730a3"] :not(button):not(input):not([style*="color"]),
[style*="background-color:#0a0d14"] :not(button):not(input):not([style*="color"]),
[style*="background-color:#0f172a"] :not(button):not(input):not([style*="color"]) {
    color: #e2e8f0 !important;
}

/* === PATTERN 3: D490 stats strip (CONFIANCE) — demo-agents.html === */
[class*="d490-stats"] *,
[class*="d490-trust"] *,
[id*="d490-stats"] *,
[class*="trust-strip"] *,
[class*="confiance"] *,
[class*="results-strip"] *,
[class*="kpi-strip"] * {
    color: #fff !important;
}
[class*="d490-stats"] .kn,
[class*="d490-stats"] .kl,
[class*="d490-trust"] .kn,
[class*="d490-trust"] .kl,
[class*="confiance"] .kn,
[class*="confiance"] .kl {
    color: #fff !important;
}

/* === PATTERN 4: Cream/light theme — H1/H2/H3 sans color explicite === */
/* weval-master-theme force body color:#2a2520 sur cream → titres invisibles */
:root[data-theme="light"] h1:not([style*="color"]):not([class*="hero"]),
:root[data-theme="light"] h2:not([style*="color"]):not([class*="hero"]):not(.hero h2),
:root[data-theme="light"] h3:not([style*="color"]):not([class*="hero"]):not(.hero h3) {
    color: #1a1a1a !important;
}

/* Pages cream sans data-theme : body bg #faf*, #fff* → titres dark */
body[style*="background:#fff"] h1:not([style*="color"]),
body[style*="background:#fff"] h2:not([style*="color"]),
body[style*="background:#faf"] h1:not([style*="color"]),
body[style*="background:#faf"] h2:not([style*="color"]) {
    color: #1B1B1B !important;
}

/* === PATTERN 5: WEVIA-ERP-UNIFIED pattern — body bg cream + h2 inherit === */
/* La page utilise --bg + --text via :root data-theme, et les h2/.hero h2 sans color */
.hero h2[id="hero-title"],
.hero h2#hero-title,
[class*="hero"] h2:not([style*="color"]) {
    color: #1a1a1a !important;
}
:root[data-theme="dark"] [class*="hero"] h2:not([style*="color"]) {
    color: #fff !important;
}

/* === PATTERN 6: Badges sur cream theme — texte dark === */
:root[data-theme="light"] .badge:not([style*="color"]):not([class*="badge-dark"]) {
    color: inherit;
}

/* === PATTERN 7: Lone <span class="kl"> labels en gray sur dark === */
:root[data-theme="dark"] .kl,
[style*="background:#0a"] .kl,
[style*="background:#0f"] .kl,
[style*="background:#1e"] .kl {
    color: #cbd5e1 !important;
}

/* === PATTERN 8: Conic-gradient orbs (mascots) === */
.d479-wevia-orb .d479-wevia-icon {
    color: #fff;
}

/* === DEV ONLY (commentable en prod) === */
/* Marqueur visuel des combinaisons impossibles */
/*
[style*="color:#fff"][style*="background:#fff"],
[style*="color:#000"][style*="background:#000"] {
    outline: 2px dashed #ef4444 !important;
}
*/

/* === D700 UNIVERSAL CONTRAST GUARD APPENDED 9mai2026 17:12 === */
/**
 * D700 UNIVERSAL CONTRAST GUARD - 9mai 2026 17:10
 * Doctrine 6 SYSTEMIQUE - patch tous les patterns clair-sur-clair / dark-sur-dark
 * 
 * Couvre 13 patterns identifies recurrents:
 * 1. text-gradient + transparent fill sur bg clair
 * 2. .speech .bubble .tooltip white-on-white
 * 3. .badge .pill .chip same-color
 * 4. .hero-title gradient cream/white invisible  
 * 5. Header brand "logo" texte
 * 6. KPI values
 * 7. Status pills
 * 8. Buttons disabled etat
 * 9. Form labels
 * 10. Modal/dialog text
 * 11. Card titles/descriptions
 * 12. Toast notifications
 * 13. Dark mode override conflicts
 * 
 * Strategy: Cascade !important avec specificity normale (eviter override total)
 * Approche fallback solid color + contraste WCAG AAA
 */

:root {
  /* === D700 SAFE TEXT COLORS === */
  --d700-text-on-light: #1f2937;        /* WCAG AAA 12.6:1 sur cream/white */
  --d700-text-on-light-muted: #4b5563;   /* WCAG AAA 7.1:1 */
  --d700-text-on-light-soft: #6b7280;    /* WCAG AA 5.5:1 */
  --d700-text-on-dark: #f1f5f9;          /* WCAG AAA */
  --d700-text-on-dark-muted: #cbd5e1;    /* WCAG AA */
  --d700-violet-fallback: #6d28d9;       /* WEVAL violet AAA on cream */
  --d700-violet-light: #8b5cf6;
  --d700-success: #166534;                /* AAA on cream */
  --d700-amber: #92400e;                  /* AAA on cream */
  --d700-error: #991b1b;                  /* AAA on cream */
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 1: text-gradient + webkit-text-fill transparent (le pire)
   ═══════════════════════════════════════════════════════════════════ */
.text-gradient,
[class*="text-gradient"],
[style*="webkit-text-fill-color: transparent"]:not([style*="background"]),
[style*="-webkit-text-fill-color:transparent"]:not([style*="background"]) {
  color: var(--d700-violet-fallback) !important;
  /* Si gradient existe ET contient #fff/#fafa.. force violet WEVAL */
}

/* Si gradient explicit cream/white -> override violet */
[style*="linear-gradient"][style*="#f8fafc"],
[style*="linear-gradient"][style*="#fafbff"],
[style*="linear-gradient"][style*="#FAF8F5"],
[style*="linear-gradient"][style*="#ffffff"],
[style*="linear-gradient"][style*="rgb(255"],
[class*="text-gradient"] {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

@supports not (-webkit-background-clip: text) {
  .text-gradient,
  [class*="text-gradient"] {
    color: var(--d700-violet-fallback) !important;
    background: none !important;
    -webkit-text-fill-color: var(--d700-violet-fallback) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 2: Speech bubbles / tooltips / popovers white-on-white
   ═══════════════════════════════════════════════════════════════════ */
.speech,
.bubble,
.tooltip,
[class*="speech"],
[class*="bubble"],
[class*="popover"],
[role="tooltip"] {
  color: var(--d700-text-on-light) !important;
  /* Force minimum readable color */
}

.speech *,
.bubble *,
.tooltip *,
[class*="bubble"] *,
[role="tooltip"] * {
  color: inherit;
}

/* Speech with explicit white/cream background -> dark text */
.speech[style*="background"][style*="rgba(255"],
.speech[style*="background"][style*="#fff"],
.speech[style*="background"][style*="white"],
[class*="bubble"][style*="background"][style*="rgba(255"],
[class*="bubble"][style*="background"][style*="#fff"] {
  color: var(--d700-text-on-light) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 3: Hero titles invisible
   ═══════════════════════════════════════════════════════════════════ */
.hero-title,
.hero-title.text-gradient,
[class*="hero"] [class*="title"] {
  color: var(--d700-violet-fallback) !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  font-weight: 700 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 4: Headers + brand + logo
   ═══════════════════════════════════════════════════════════════════ */
.app-header,
.app-header *:not([class*="brand-icon"]):not([class*="positive"]):not([class*="negative"]),
header.app-header *,
[class*="app-header"] [class*="brand"]:not([class*="brand-icon"]),
[class*="app-header"] h1,
[class*="app-header"] [class*="title"] {
  color: var(--d700-text-on-light) !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

/* Header containers avoid text cutoff */
header, .header, .app-header, .top-header, [class*="navbar"] {
  overflow: visible !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 5: KPI / pills / chips
   ═══════════════════════════════════════════════════════════════════ */
[class*="kpi"]:not([style*="color"]),
[class*="pill"]:not([style*="color"]),
[class*="chip"]:not([style*="color"]),
[class*="stat-pill"],
[class*="stat-value"]:not([style*="color"]) {
  color: var(--d700-text-on-light) !important;
}

/* Status semantic colors (override generic) */
[class*="kpi-green"], [class*="status-ok"], [class*="status-success"],
[class*="positive"]:not([class*="negative"]) { 
  color: var(--d700-success) !important; 
}
[class*="kpi-amber"], [class*="status-warn"], [class*="status-pending"] { 
  color: var(--d700-amber) !important; 
}
[class*="kpi-red"], [class*="status-error"], [class*="negative"] { 
  color: var(--d700-error) !important; 
}
[class*="kpi-violet"], [class*="status-live"] { 
  color: var(--d700-violet-fallback) !important; 
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 6: Cards on cream/white background
   ═══════════════════════════════════════════════════════════════════ */
.card[style*="background:#fff"]:not([style*="color"]),
.card[style*="background: #fff"]:not([style*="color"]),
.card[style*="background:#fafa"]:not([style*="color"]),
[class*="card"][style*="background:#fff"] *:not([class*="text-"]):not([style*="color"]) {
  color: var(--d700-text-on-light);
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 7: Headings without explicit color
   ═══════════════════════════════════════════════════════════════════ */
body h1:not([style*="color"]):not([class*="text-"]):not([class*="hero"]):not(.pitch *):not(.pitch),
body h2:not([style*="color"]):not([class*="text-"]):not([class*="hero"]):not(.pitch *):not(.pitch),
body h3:not([style*="color"]):not([class*="text-"]):not([class*="hero"]):not(.pitch *):not(.pitch),
body h4:not([style*="color"]):not([class*="text-"]):not(.pitch *):not(.pitch) {
  color: var(--d700-text-on-light) !important;
}

/* D700-FIX: scope dark sections - text must be light */
body .pitch h1:not([style*="color"]),
body .pitch h2:not([style*="color"]),
body .pitch h3:not([style*="color"]),
body .pitch h4:not([style*="color"]),
body .pitch h5:not([style*="color"]),
body .pitch h6:not([style*="color"]),
body .pitch p:not([style*="color"]),
body .ct h1:not([style*="color"]),
body .ct h2:not([style*="color"]),
body .ct h3:not([style*="color"]),
body .ct h4:not([style*="color"]),
body .ct p:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h1:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h2:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h3:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h4:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] p:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h1:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h2:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h3:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h4:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] p:not([style*="color"]) {
  color: #fff !important;
}

/* Dans contexte dark explicite -> texte clair */
[data-theme="dark"] body h1:not([style*="color"]),
body.theme-night h1:not([style*="color"]),
body[style*="background:#0"] h1:not([style*="color"]) {
  color: var(--d700-text-on-dark) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 8: Modals / dialogs
   ═══════════════════════════════════════════════════════════════════ */
.modal:not([style*="background"]) *:not([class*="text-"]):not(button):not(input),
[role="dialog"] *:not([class*="text-"]):not(button):not(input),
[class*="modal"]:not([style*="background"]) > div *:not([class*="text-"]) {
  color: var(--d700-text-on-light);
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 9: Form labels + placeholders
   ═══════════════════════════════════════════════════════════════════ */
label:not([style*="color"]) {
  color: var(--d700-text-on-light) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--d700-text-on-light-soft) !important;
  opacity: 1 !important;
}

input:not([style*="color"]),
textarea:not([style*="color"]),
select:not([style*="color"]) {
  color: var(--d700-text-on-light) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 10: Toast / notifications
   ═══════════════════════════════════════════════════════════════════ */
.toast:not([style*="color"]),
[class*="toast"]:not([style*="color"]),
[class*="notification"]:not([style*="color"]),
[class*="alert"]:not([style*="background:#0"]):not([class*="alert-dark"]) {
  color: var(--d700-text-on-light) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 11: Logout button (recurrent global)
   ═══════════════════════════════════════════════════════════════════ */
button[onclick*="logout"]:not([style*="color"]),
a[href*="logout"]:not([style*="color"]),
.logout:not([style*="color"]),
[class*="logout"]:not([style*="color"]) {
  color: var(--d700-text-on-light-muted) !important;
  background: transparent !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
}

button[onclick*="logout"]:hover,
a[href*="logout"]:hover,
.logout:hover {
  color: var(--d700-violet-fallback) !important;
  border-color: var(--d700-violet-fallback) !important;
  background: rgba(124,58,237,0.05) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 12: Disabled buttons (a11y)
   ═══════════════════════════════════════════════════════════════════ */
button:disabled,
[disabled]:not([class*="text-"]) {
  color: var(--d700-text-on-light-soft) !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 13: Force focus visible AAA
   ═══════════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--d700-violet-fallback) !important;
  outline-offset: 2px !important;
}

/* D702 v3 ULTRA SPECIFICITY 9mai 19:05 */

html body div.dc-erp,
html body div.dc-erp[class],
html body [class*="dc-erp"][class] {
  color: #1e293b !important;
  background-color: #eef2ff !important;
  font-weight: 700 !important;
}

html body div.dc-pain,
html body div.dc-pain[class],
html body [class*="dc-pain"][class] {
  color: #991b1b !important;
}

html body div.dc-m,
html body div.dc-m[class] {
  color: #475569 !important;
}

html body span.gp,
html body span.gp[class],
html body .gp[class] {
  color: #7f1d1d !important;
  background-color: #fee2e2 !important;
  font-weight: 700 !important;
}

/* D701-ULTIMATE 9mai 19:15 - Comprehensive widget dedup */

@media (min-width: 769px) {
  body #d483-live-widget {
    position: fixed !important;
    bottom: 96px !important;
    right: 24px !important;
    top: auto !important;
    z-index: 99950 !important;
  }
  body #d470-fab {
    position: fixed !important;
    bottom: 168px !important;
    right: 24px !important;
    top: auto !important;
    z-index: 99955 !important;
  }
  body #d466-sticky-cta-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99940 !important;
  }
  /* D507 v9 10mai - REMOVED bad d701 floating-cta rule (broke layout)
     See d701-desktop-fix.css for correct version */
  body [class*="floating-cta"]:not([class*="bar"]):not(#d466-sticky-cta-bar) {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    padding-right: 100px !important;
    z-index: 99945 !important;
  }
}

@media (max-width: 768px) {
  body #d466-sticky-cta-bar {
    bottom: 0 !important;
    z-index: 99940 !important;
  }
}

/* =====================================================================
   D507 v3 - APPENDED 10mai2026 - ROOT CAUSE FIX (Strike Rule applied)
   Generic patterns to cover ALL future components without enumeration:
   - Gradient backgrounds without bg-color fallback
   - Sections with violet/purple/dark linear-gradients
   - Generic prefix matchers (p[0-9]+-*) for future component naming
   ===================================================================== */

/* === PATTERN: ANY element with linear-gradient inline OR class-based ===
   Rule: if has linear-gradient AND text is white/light, force bg-color fallback */

/* Sections with violet gradients (.pitch + future violet sections) */
.pitch,
.pitch-feature,
[class*="pitch"]:not(.pitch-btn),
section[class*="cta"]:not(.cta-light),
[class*="-violet"],
[class*="-purple"],
[style*="linear-gradient(135deg, #6366f1"],
[style*="linear-gradient(135deg,#6366f1"],
[style*="linear-gradient(135deg, rgb(99, 102, 241)"] {
    background-color: #6366f1 !important; /* Fallback for WCAG checkers */
}

.pitch * { color: #fff !important; }
.pitch h2, .pitch h3, .pitch h4 { color: #fff !important; font-weight: 800; }
.pitch p { color: rgba(255,255,255,0.95) !important; }
.pitch-feature {
    background-color: rgba(99,102,241,0.85) !important;
    border: 1px solid rgba(255,255,255,0.25);
}
.pitch-feature h4 { color: #fff !important; }
.pitch-feature p { color: rgba(255,255,255,0.92) !important; }

/* Hero CTAs with linear-gradient */
.hero-cta,
.p36-roi-cta,
.pitch-btn:not(.outlined),
a[class*="-cta"]:not([class*="outlined"]),
button[class*="-cta"]:not([class*="outlined"]) {
    background-color: #6366f1 !important;
    color: #fff !important;
}
.pitch-btn.outlined { 
    background-color: transparent !important; 
    color: #fff !important; 
    border: 2px solid rgba(255,255,255,0.6) !important; 
}

/* Generic: any text-white element with no bg-color fallback gets a safe parent bg */
[style*="color:#fff"]:not([style*="background"]):not(button):not(a),
[style*="color: #fff"]:not([style*="background"]):not(button):not(a),
[style*="color:white"]:not([style*="background"]):not(button):not(a) {
    /* Don't override - parents must provide bg */
}

/* === PATTERN: GENERIC PREFIX MATCHERS for future components === */
/* p2x / p3x / p4x prefix conventions (D-AUDIT batches) */
/* Default safe colors for any p2x-* p3x-* card with white parent */
[id^="p2"][id*="-"], [id^="p3"][id*="-"], [id^="p4"][id*="-"] {
    /* Containers OK */
}

/* Any descendants of dark sections must be light */
[style*="background:#0f172a"] *,
[style*="background:#0a0a14"] *,
[style*="background:#0a0d14"] *,
[style*="background:#1e1b4b"] *,
[style*="background:linear-gradient(135deg,#0f172a"] *,
[style*="background:linear-gradient(135deg, #0f172a"] *,
[style*="background: linear-gradient(135deg, #0f172a"] * {
    color: inherit;
}
.hero[style*="0f172a"] h1, .hero[style*="0f172a"] h2, 
.hero[style*="1e1b4b"] h1, .hero[style*="1e1b4b"] h2 {
    color: #fff !important;
}

/* === PATTERN: P28-P38 specific guards (current batch) === */
.p28-case-card { background: #fff !important; }
.p28-case-card * { color: inherit; }
.p28-case-logo { color: #1e293b !important; font-weight: 800; }
.p28-case-sector { color: #6366f1 !important; }
.p28-case-quote { color: #475569 !important; }
.p28-case-result-num { color: #047857 !important; }
.p28-case-result-lbl { color: #64748b !important; }

.p35-analyst-card { background: #fff !important; }
.p35-analyst-card-name { color: #1e293b !important; }
.p35-analyst-card-quote { color: #475569 !important; }
.p35-analyst-card-source { color: #94a3b8 !important; }

.p36-roi-result { color: #fff !important; background-color: #0f172a !important; }
.p36-roi-result * { color: inherit; }
.p36-roi-result-num { color: #fff !important; }
.p36-roi-result-sub { color: #c7d2fe !important; }
.p36-roi-result-label { color: #a78bfa !important; }
.p36-roi-bd-num { color: #fff !important; }
.p36-roi-bd-lbl { color: #94a3b8 !important; }

.p36-phase-card { background: #fff !important; }
.p36-phase-name { color: #1e293b !important; }
.p36-phase-duration { color: #6366f1 !important; }
.p36-phase-desc { color: #64748b !important; }

.p36-urgency-card { background: #fff !important; }
.p36-urgency-name { color: #1e293b !important; }
.p36-urgency-desc { color: #475569 !important; }
.p36-urgency-deadline { color: #dc2626 !important; }

/* Maturity public page guards */
.score-num { color: #047857 !important; }
.axis-card { background: #fff !important; }
.axis-name { color: #1e293b !important; }
.axis-pct { color: #10b981 !important; font-weight: 900; }
.axis-detail { color: #64748b !important; }
.compliance-card { background: #fff !important; }
.compliance-name { color: #1e293b !important; }
.compliance-desc { color: #475569 !important; }

/* === ANTI-WHITE-ON-WHITE GUARD === */
/* Force any white text to have a non-white background */
*[style*="color:#fff"] { background-color: inherit; }
*[style*="color: white"] { background-color: inherit; }

/* Final safety: detect if rendered with white-on-white at runtime via :where() */
@supports (color: color-mix(in srgb, white, black)) {
  /* Modern browsers - we trust JS guard */
}

/* === Dark mode fallback === */
body.p34-dark .axis-card,
body.p34-dark .compliance-card,
body.p34-dark .p28-case-card,
body.p34-dark .p35-analyst-card,
body.p34-dark .p36-phase-card,
body.p34-dark .p36-urgency-card { 
    background: #1e293b !important; 
    border-color: #334155 !important; 
}
body.p34-dark .axis-name,
body.p34-dark .compliance-name,
body.p34-dark .p28-case-logo,
body.p34-dark .p35-analyst-card-name,
body.p34-dark .p36-phase-name,
body.p34-dark .p36-urgency-name { color: #f1f5f9 !important; }
body.p34-dark .axis-detail,
body.p34-dark .compliance-desc,
body.p34-dark .p28-case-quote,
body.p34-dark .p35-analyst-card-quote,
body.p34-dark .p36-phase-desc,
body.p34-dark .p36-urgency-desc { color: #cbd5e1 !important; }

/* =====================================================================
   D507 v4 - 10mai2026 - REGRESSION FIX from v3
   v3 introduced bg=color on score-num. Fix:
   ===================================================================== */

/* Score num: vert on white BG, NOT vert on vert */
.score-num {
    color: #047857 !important;
    background: transparent !important;
    background-color: transparent !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #047857 !important;
}

/* axis-pct must have darker green for AA */
.axis-pct {
    color: #047857 !important; /* darker green: 4.95:1 vs white */
    background: transparent !important;
}

/* Pitch text: force WHITE on violet, override any inherited dark text */
.pitch,
.pitch * {
    color: #fff !important;
}
.pitch h2, .pitch h3, .pitch h4 { 
    color: #fff !important; 
    -webkit-text-fill-color: #fff !important;
}
.pitch p, .pitch .pitch-feature p, .pitch-feature h4 { 
    color: #fff !important; 
    -webkit-text-fill-color: #fff !important;
}

/* Footer text on light bg: must be darker grey for AA */
.footer, .footer div {
    color: #475569 !important; /* 7.0:1 on white */
}

/* === Anti-regression: bg-color = color === */
.ca-tag {
    color: #1e293b !important;
    background: #eef2ff !important;
}
[class$="-tag"], 
[class*=" ca-tag"] {
    color: #1e293b !important;
    background-color: #eef2ff !important;
}

/* Score-num inner: even if container has gradient, ensure fg is forced */
.score-num,
.score-meta h2,
.axis-name {
    -webkit-text-fill-color: initial !important;
}
.score-num { -webkit-text-fill-color: #047857 !important; color: #047857 !important; }
.score-meta h2 { color: #047857 !important; }
.axis-name { color: #1e293b !important; }

/* Hero CTA on dark hero: white text + violet bg fallback */
.hero-cta { 
    color: #fff !important; 
    background-color: #6366f1 !important;
}

/* Pitch CTAs: white text + correct bg */
.pitch-btn:not(.outlined) { 
    color: #6366f1 !important; 
    background-color: #fff !important;
}
.pitch-btn.outlined { 
    color: #fff !important; 
    background-color: transparent !important; 
    border: 2px solid rgba(255,255,255,0.6) !important; 
}

/* Footer link */
.footer a { color: #6366f1 !important; }

/* =====================================================================
   D507 v5 - 10mai2026 - SPECIFICITY FIX
   weval-master-theme.css uses 'html body h2' (specificity 0,1,3)
   We must match or exceed to override (0,1,3) + !important
   ===================================================================== */

/* Pitch text - HIGH SPECIFICITY override */
html body .pitch,
html body .pitch * { color: #fff !important; }

html body .pitch h1,
html body .pitch h2,
html body .pitch h3,
html body .pitch h4,
html body .pitch h5,
html body .pitch h6 {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html body .pitch p,
html body .pitch .pitch-feature p,
html body .pitch-feature h4 {
    color: #fff !important;
}

html body .pitch-btn:not(.outlined) { 
    color: #6366f1 !important; 
    background-color: #fff !important;
}
html body .pitch-btn.outlined { 
    color: #fff !important; 
    background-color: transparent !important;
}

html body .hero-cta,
html body a.hero-cta { 
    color: #fff !important; 
    background-color: #6366f1 !important;
}

/* Same approach for any other dark/violet sections we might add */
html body .ct,
html body .ct * { color: #fff !important; }
html body section[class*="cta"][class*="-violet"] *,
html body section[class*="cta"][class*="-purple"] * { color: #fff !important; }

/* Generic: any element inside section with linear-gradient violet/dark bg */
html body section[style*="linear-gradient"][style*="6366f1"] h1,
html body section[style*="linear-gradient"][style*="6366f1"] h2,
html body section[style*="linear-gradient"][style*="6366f1"] h3,
html body section[style*="linear-gradient"][style*="6366f1"] h4,
html body section[style*="linear-gradient"][style*="6366f1"] p {
    color: #fff !important;
}

/* WEVIA Score card on demo-agents (link to maturity) */
html body a.p35-analyst-card[style*="064e3b"] *,
html body a.p35-analyst-card[href*="maturity"] * {
    color: inherit !important;
}

/* Buttons with violet bg = white text */
html body button[style*="linear-gradient(135deg,#6366f1"],
html body button[style*="linear-gradient(135deg, #6366f1"],
html body a[style*="linear-gradient(135deg,#6366f1"],
html body a[style*="linear-gradient(135deg, #6366f1"] {
    color: #fff !important;
}

/* =====================================================================
   D700 P41 ROOT FIX - 10mai2026 Yacine D607
   Cause racine: D700 body h1:not([class*="hero"]) ne capte que la classe 
   directe du h1, pas son ascendant <header class="hero">. 
   Donc h1 sans classe -> piege par body h1:not(...) -> color #1f2937 sur fond dark.
   
   Fix: regles scope-style "dark section -> light text" avec specificite >= D700.
   Couvre TOUS futurs composants dark sans enumeration manuelle.
   ===================================================================== */

/* Hero/dark sections : force texte clair (specificite 0,2,4 = 24, mais !important gagne sur D700 !important) */
body header.hero h1,
body header.hero h2,
body header.hero h3,
body header.hero h4,
body header.hero p,
body section.hero h1,
body section.hero h2,
body section.hero h3,
body section.hero p,
body .hero h1,
body .hero h2,
body .hero h3,
body .hero h4,
body .hero-badge,
body [class*="hero-"]:not(.hero-cta) {
  color: #ffffff !important;
}

/* Hero badge: green pill - texte SOMBRE pour AAA */
body .hero-badge,
body header.hero .hero-badge,
body [class*="badge"][class*="hero"] {
  color: #064e3b !important;
  background: linear-gradient(135deg, #4ade80, #22c55e) !important;
  font-weight: 700 !important;
}

/* Hero CTA primary button - violet plus fonce pour AA strict (4.5+) */
body .hero-cta,
body header.hero .hero-cta,
body section.hero .hero-cta {
  color: #ffffff !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  background-color: #4f46e5 !important;
  border: 2px solid #4f46e5 !important;
  font-weight: 600 !important;
}

/* Subtitle paragraph in hero - blanc cassé pour confort lecture */
body header.hero p,
body section.hero p,
body .hero p {
  color: #e2e8f0 !important;
}

/* Strong text in hero (le "100% Advanced" en gras) */
body header.hero strong,
body section.hero strong,
body .hero strong {
  color: #4ade80 !important;
}

/* Source line italic */
body header.hero em,
body section.hero em,
body .hero em {
  color: #94a3b8 !important;
}

/* =====================================================================
   D700 P41-v2 ROOT FIX VIA CSS VARIABLES - 10mai2026 D607
   Cascade-proof: au lieu de combattre specificite D700 = (0,5,2),
   on REDEFINIT la variable --d700-text-on-light dans le scope dark sections.
   var() resout au contexte le plus proche -> bulletproof.
   ===================================================================== */

/* Hero & dark sections: redefinir variable -> tout texte var(--d700-text-on-light) devient blanc */
header.hero,
section.hero,
.hero,
[data-bg="dark"],
[class*="dark-section"],
.pitch,
.ct {
  --d700-text-on-light: #ffffff;
  --weval-text: #ffffff;
}

/* Hero badge: green pill - texte SOMBRE (override la var pour ce composant interne) */
.hero-badge,
header.hero .hero-badge,
[class*="badge"][class*="hero"] {
  --d700-text-on-light: #064e3b;
  color: #064e3b !important;
  background: linear-gradient(135deg, #4ade80, #22c55e) !important;
  font-weight: 700 !important;
}

/* Hero CTA primary - violet bg + texte blanc */
.hero-cta,
header.hero .hero-cta,
section.hero .hero-cta {
  --d700-text-on-light: #ffffff;
  color: #ffffff !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  background-color: #4f46e5 !important;
  border: 2px solid #4f46e5 !important;
  font-weight: 600 !important;
}

/* Subtitle paragraph dans hero - blanc cassé */
header.hero p,
section.hero p,
.hero p {
  --d700-text-on-light: #e2e8f0;
  color: #e2e8f0 !important;
}

/* Strong text dans hero (le "100% Advanced" en gras) */
header.hero strong,
section.hero strong,
.hero strong {
  --d700-text-on-light: #4ade80;
  color: #4ade80 !important;
}

/* Source line italic */
header.hero .hero-source,
section.hero .hero-source,
.hero .hero-source,
header.hero em,
.hero em {
  --d700-text-on-light: #94a3b8;
  color: #94a3b8 !important;
}
/*--- d508-pale-on-pale-fix ---*/
/* D825 EMPTY STUB - replaces missing legacy CSS
 * Original purpose: legacy contrast/theme/readability fix
 * Removed because: file was deleted but still referenced in HTML pages
 * Replaced with empty stub to eliminate 404 console errors
 * Date: 2026-05-13
 * No styles applied - the canonical wevia-palette-unified.css handles everything
 */
/*--- d515-readability-emergency ---*/
/* D825 EMPTY STUB - replaces missing legacy CSS
 * Original purpose: legacy contrast/theme/readability fix
 * Removed because: file was deleted but still referenced in HTML pages
 * Replaced with empty stub to eliminate 404 console errors
 * Date: 2026-05-13
 * No styles applied - the canonical wevia-palette-unified.css handles everything
 */
/*--- wevia-contrast-guard ---*/
/* ============================================================
   WEVIA CONTRAST GUARD v2 — extension pour patterns extrêmes
   Date: 02 mai 2026
   Ajouts vs v1 (FAQ déjà couvert):
   - kpi-pill cyan-on-cyan (contact.html)
   - nav-link slate-on-indigo (header global)
   - h4 sans classe (Nos bureaux white-on-white)
   - a.d472-skip-link (a11y)
   - patterns badge/chip avec same-color bug
   ============================================================ */

:root {
  --wcg-text-on-dark: #f1f5f9;
  --wcg-text-on-dark-muted: #cbd5e1;
  --wcg-text-on-light: #0f172a;
  --wcg-text-on-light-muted: #475569;
}

/* ZONE FAQ wr-faq-* (v1 conservé) */
.wr-faq-q { color: var(--wcg-text-on-dark) !important; background: #0f172a !important; font-weight: 600; }
.wr-faq-q:hover { color: #ffffff !important; }
.wr-faq-q span { color: inherit !important; }
.wr-faq-arrow { color: #6366f1 !important; }
.wr-faq-a, .wr-faq-a *, .wr-faq-a p { color: var(--wcg-text-on-dark-muted) !important; }
.wr-faq-a a { color: #818cf8 !important; }
.wr-faq-title { color: var(--wcg-text-on-dark) !important; }

/* ZONE FAQ d491-* */
.d491-faq-q, .d491-faq-q span { color: var(--wcg-text-on-dark) !important; }
.d491-faq-a, .d491-faq-a * { color: var(--wcg-text-on-dark-muted) !important; }
.d491-faq-title { color: var(--wcg-text-on-dark) !important; }

/* ZONE Modal wr-modal */
.wr-modal, .wr-modal h2, .wr-modal label { color: var(--wcg-text-on-dark) !important; }
.wr-modal p { color: var(--wcg-text-on-dark-muted) !important; }
.wr-modal input, .wr-modal select, .wr-modal textarea { color: var(--wcg-text-on-dark) !important; background: #1e293b !important; }
.wr-modal input::placeholder, .wr-modal textarea::placeholder { color: #64748b !important; }

/* ZONE Cases */
.wr-cases-section, .wr-cases-title, .wr-case-card h3 { color: var(--wcg-text-on-dark) !important; }
.wr-case-card p, .wr-case-card { color: var(--wcg-text-on-dark-muted) !important; }
.wr-case-card { background: #0f172a !important; }

/* ZONE theme-light button override fix */
body.theme-light .wr-faq-q,
body.theme-light .wr-cta-btn,
body.theme-light .wr-form-submit,
body.theme-light .wr-modal button,
body.theme-light .wr-faq-section button,
body.theme-light .wr-cases-section button,
body.theme-light .d491-faq-q,
body.theme-light [class^="wr-"] button:not(.wr-cta-close):not(.wr-modal-close) {
  color: var(--wcg-text-on-dark) !important;
}
body.theme-light .wr-cta-secondary { color: #a5b4fc !important; }

/* ============================================================
   v2 ADDITIONS — Patterns extrêmes que le runtime ne peut pas atteindre
   ============================================================ */

/* PATTERN 1: kpi-pill cyan-on-cyan (page contact.html — bug visible) */
.kpi-pill {
  color: #0f172a !important;
  font-weight: 600;
}
/* Variante avec bg explicite cyan/teal */
.kpi-pill[style*="background"], 
span.kpi-pill {
  color: #0f172a !important;
}

/* PATTERN 2: nav-link sur background indigo (header global) */
button.nav-link,
a.nav-link {
  color: #f1f5f9 !important;
}
button.nav-link:hover,
a.nav-link:hover {
  color: #ffffff !important;
}

/* PATTERN 3: h4 "Nos bureaux" white-on-white dans containers transparents */
h4:not([class]):not([id]) {
  color: var(--wcg-text-on-dark) !important;
}
/* h4 avec emoji 🌍 + texte simple = candidat fix */
h4 { color: var(--wcg-text-on-dark, #f1f5f9); }

/* PATTERN 4: skip-link a11y (apparaît en focus, doit être contrasté) */
a.d472-skip-link,
.skip-link {
  color: #ffffff !important;
  background: #0f172a !important;
  text-decoration: underline;
}
a.d472-skip-link:focus,
.skip-link:focus {
  outline: 3px solid #fbbf24 !important;
  outline-offset: 2px;
}

/* PATTERN 5: badges/chips/tags avec texte invisible (heuristique générique) */
.badge, .chip, .tag, .pill, .label-pill, .stat-pill,
[class*="-badge"], [class*="-chip"], [class*="-tag"], [class*="-pill"] {
  /* Si le bg est défini, force un text contrasté de base */
  font-weight: 600;
}
/* Si la couleur de fond est cyan/teal (pattern récurrent) */
.kpi-pill[style*="cyan"],
.kpi-pill[style*="22d3ee"],
[class*="-pill"][style*="cyan"],
[style*="background:#22d3ee"],
[style*="background: #22d3ee"],
[style*="background-color:#22d3ee"] {
  color: #0f172a !important;
}

/* PATTERN 6: Service-source slate-on-dark */
span.service-source { color: var(--wcg-text-on-dark-muted) !important; }

/* PATTERN 7: Hero h2 excellence-main-title sur cream */
h2.excellence-main-title { color: var(--wcg-text-on-light) !important; }

/* PATTERN 8: services-button et services-title */
button.services-button,
h4.services-title,
a.services-link { color: var(--wcg-text-on-light) !important; }

/* PATTERN 9: wr-service-link sur backgrounds clairs */
a.wr-service-link { color: var(--wcg-text-on-light) !important; font-weight: 600; }

/* PATTERN 10: Login labels (page wevia-master.html / admin.html) */
label[for*="user"], label[for*="pass"], label[for*="login"],
form label { color: var(--wcg-text-on-dark) !important; }

/* ============================================================
   ZONE generic dark-on-dark / light-on-light via inline style
   ============================================================ */
[style*="background:#0"] *:not([style*="color"]):not(.wr-cta-btn),
[style*="background: #0"] *:not([style*="color"]):not(.wr-cta-btn),
[style*="background:rgba(0,0,0"] *:not([style*="color"]),
[style*="background:rgba(15,23,42"] *:not([style*="color"]),
[style*="background:#1"] *:not([style*="color"]) {
  color: #cbd5e1;
}
[style*="background:#0"] h1, [style*="background:#0"] h2,
[style*="background:#0"] h3, [style*="background:#0"] h4,
[style*="background: #0"] h1, [style*="background: #0"] h2,
[style*="background: #0"] h3, [style*="background: #0"] h4,
[style*="background:#1"] h1, [style*="background:#1"] h2,
[style*="background:#1"] h3, [style*="background:#1"] h4 {
  color: #f1f5f9;
}

/* Light-on-light inverse */
[style*="background:#fff"] *:not([style*="color"]):not([class*="btn-primary"]):not([class*="cta-primary"]),
[style*="background: #fff"] *:not([style*="color"]):not([class*="btn-primary"]):not([class*="cta-primary"]),
[style*="background:#FFF"] *:not([style*="color"]):not([class*="btn-primary"]) {
  color: #0f172a;
}

/* ZONE A11Y focus visible */
.wr-faq-q:focus-visible,
.d491-faq-q:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* FIN — WEVIA CONTRAST GUARD v2 */
/*--- d808-banner-cleanup ---*/
/* D811 LEAN BANNER + KILL DUPLICATES */

/* === STEP 1: Hide ALL fixed-bottom CTA-ish elements === */
[id*="sticky-cta"]:not(#d466-sticky-cta-bar),
[id*="bottom-cta"], [id*="floating-cta"], [id*="lead-magnet"],
[class*="sticky-cta"]:not(#d466-sticky-cta-bar),
[class*="bottom-cta"], [class*="floating-cta"], [class*="cta-banner"],
[class*="bottom-banner"], [class*="lead-bar"], [class*="bookcall-bar"],
[class*="bottom-promo"], [class*="cta-floating"],
div[style*="position:fixed"][style*="bottom"]:not(#d466-sticky-cta-bar):not([class*="chat"]):not([class*="avatar"]):not([class*="whatsapp"]):not([class*="wevia-live"]) {
  display: none !important;
}

/* === STEP 2: keep ONLY #d466-sticky-cta-bar as the single lean pill === */
#d466-sticky-cta-bar {
  display: flex !important;
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  transform: translateX(-50%) !important;
  
  /* Lean pill - max-width small */
  width: auto !important;
  max-width: min(540px, calc(100vw - 32px)) !important;
  min-width: 0 !important;
  
  /* Pill shape */
  border-radius: 999px !important;
  
  /* Tight padding */
  padding: 10px 10px 10px 20px !important;
  
  /* Layout */
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  flex-wrap: nowrap !important;
  flex-direction: row !important;
  
  /* Solid brand gradient */
  background: linear-gradient(90deg, #3730A3, #4F46E5) !important;
  background-image: linear-gradient(90deg, #3730A3, #4F46E5) !important;
  background-color: #3730A3 !important;
  
  /* Subtle shadow */
  box-shadow: 0 8px 28px rgba(55,48,163,0.30), 0 2px 6px rgba(0,0,0,0.08) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  
  /* Typography */
  color: #ffffff !important;
  font: 500 13px/1.3 system-ui, -apple-system, sans-serif !important;
  
  z-index: 9000 !important;
}

/* Text inside - compact */
#d466-sticky-cta-bar .msg, #d466-sticky-cta-bar .msg-mobile,
#d466-sticky-cta-bar span:not(.close-x), #d466-sticky-cta-bar p {
  color: #ffffff !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
@media (min-width: 640px) { #d466-sticky-cta-bar .msg-mobile { display: none !important; } }
@media (max-width: 639px) { #d466-sticky-cta-bar .msg:not(.msg-mobile) { display: none !important; } }

/* CTA button - small white pill inside */
#d466-sticky-cta-bar a.cta-btn, #d466-sticky-cta-bar a[data-d466-cta],
#d466-sticky-cta-bar a:not(.close-x) {
  background: #ffffff !important;
  color: #3730A3 !important;
  padding: 7px 16px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  border: none !important;
  cursor: pointer !important;
}
#d466-sticky-cta-bar a.cta-btn:hover {
  background: #f5f1ec !important;
  transform: translateY(-1px) !important;
}

/* Close X - small subtle */
#d466-sticky-cta-bar .close-x {
  width: 26px !important; height: 26px !important; min-width: 26px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}
#d466-sticky-cta-bar .close-x:hover { background: rgba(255,255,255,0.25) !important; }

/* Mobile */
@media (max-width: 640px) {
  #d466-sticky-cta-bar {
    bottom: 12px !important;
    padding: 8px 8px 8px 14px !important;
    max-width: calc(100vw - 16px) !important;
    gap: 10px !important;
  }
  #d466-sticky-cta-bar a.cta-btn { padding: 6px 12px !important; font-size: 11px !important; }
}

/* Body padding to not hide content under pill */
body { padding-bottom: 80px !important; }

/* Chat widgets coexist above pill */
[class*="chat-widget"], [class*="wevia-assistant"], [class*="whatsapp-btn"],
[class*="wevia-avatar"], [class*="wevia-live"], [class*="floating-chat"] {
  bottom: 80px !important;
}
/* D811b - WEVIA Avatar popup d710 sizing - dont auto-open via JS patch, manual click only */
#d710-pop { max-height: 70vh !important; max-width: min(380px, calc(100vw - 32px)) !important; right: 24px !important; top: 80px !important; }
#d710-av { bottom: 90px !important; }
/* Cookie consent banner compact */
#weval-cc-banner, [class*="cc-banner"], [id*="cookie-banner"] { max-width: min(600px, calc(100vw - 32px)) !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important; bottom: 90px !important; border-radius: 14px !important; box-shadow: 0 8px 28px rgba(0,0,0,0.15) !important; padding: 12px 20px !important; font-size: 13px !important; }
/*--- d810-emergency-visibility ---*/
/* D810-EMERGENCY-VISIBILITY-FIX — force text dark everywhere except accents */

/* === Force dark text on all content === */
body, body p, body div, body span, body h1, body h2, body h3, body h4, body h5, body h6,
body li, body td, body th, body section, body section *, body article, body article *,
body header h1, body header h2, body footer p, body main *, body aside *,
[class*="card"] p, [class*="card"] div:not([class*="badge"]):not([class*="logo"]),
[class*="card"] h1, [class*="card"] h2, [class*="card"] h3, [class*="card"] h4,
[class*="card"] span, [class*="card"] li,
[class*="panel"] *:not([class*="badge"]):not([class*="logo"]),
[class*="kpi"] *:not([class*="badge"]):not([class*="logo"]),
[class*="matrix"] *, [class*="pred"] *, [class*="dashboard"] *,
[class*="grid"] > *, [class*="row"] > *, [class*="block"] > *,
.partner-name, .partner-tier, [class*="partner"] *:not([class*="logo"]) {
  color: #1B1B1B !important;
}

/* === Muted secondary text === */
[class*="muted"], [class*="secondary"], [class*="sub"], [class*="caption"],
small, .text-muted, .text-secondary {
  color: #555555 !important;
}

/* === Brand/accent text preserved === */
[class*="brand"], [class*="accent"], [class*="primary-color"],
[style*="color:#"], [style*="color: #"] {
  color: revert;
}

/* === Banner CTA stays white text === */
#d466-sticky-cta-bar, #d466-sticky-cta-bar *,
[id*="sticky-cta"], [id*="sticky-cta"] *,
[class*="sticky-cta"], [class*="sticky-cta"] *,
[class*="cta-bar"], [class*="cta-bar"] * {
  color: #ffffff !important;
}
/* Except button which is indigo on white pill */
#d466-sticky-cta-bar a.cta-btn,
[id*="sticky-cta"] a.cta-btn, [id*="sticky-cta"] a:not(.close-x),
[class*="sticky-cta"] a.cta-btn {
  color: #3730A3 !important;
  background: #ffffff !important;
}

/* === Headings explicitly dark === */
h1, h2, h3, h4, h5, h6 { color: #1B1B1B !important; }

/* === Links - keep indigo brand === */
a:not([class*="btn"]):not([class*="button"]):not(.close-x) {
  color: #3730A3 !important;
}
a:hover { color: #4F46E5 !important; }

/* === Form elements === */
input, textarea, select, label {
  color: #1B1B1B !important;
  background-color: #ffffff !important;
}

/* === Status badges keep their colors === */
[class*="badge"], [class*="pill"]:not([class*="cta"]), [class*="chip"],
[class*="tag"]:not([class*="title"]), [class*="status"] {
  color: revert;
}

/* === Logos keep gradient text === */
[class*="logo"], [class*="brand-mark"], [class*="icon"] {
  color: revert;
}
/*--- d812-max-priority ---*/
/* D814 — Demo-Agents UX canonical doctrine Yacine — propagated to all pages */

/* === Google Font DM Sans === */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700;800&display=swap');

/* === Demo-agents CSS variables === */
:root, html, body {
  --bg: #faf7f5 !important;
  --bg2: #FFFFFF !important;
  --fg: #1B1B1B !important;
  --fg2: #555555 !important;
  --fg3: #999999 !important;
  --a: #3730A3 !important;
  --al: #6366F1 !important;
  --g: #047857 !important;
  --r: #B91C1C !important;
  --o: #B45309 !important;
  --bd: #E8E2D9 !important;
  --R: 16px !important;
  --sh: 0 1px 3px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.03) !important;
  /* Backward compat vars */
  --bg-primary: #faf7f5 !important;
  --bg-secondary: #FFFFFF !important;
  --bg3: #FFFFFF !important;
  --text: #1B1B1B !important;
  --text-main: #1B1B1B !important;
  --text-primary: #1B1B1B !important;
  --text-secondary: #555555 !important;
  --text-muted: #999999 !important;
  --ink: #1B1B1B !important;
  --foreground: #1B1B1B !important;
  --card: #FFFFFF !important;
  --panel: #FFFFFF !important;
  --surface: #faf7f5 !important;
  --base: #faf7f5 !important;
  --paper: #faf7f5 !important;
  --background: #faf7f5 !important;
  --canvas: #faf7f5 !important;
  --void: #faf7f5 !important;
  --depth: #faf7f5 !important;
  --header-bg: #FFFFFF !important;
  --nav-bg: #FFFFFF !important;
}

/* === Restore animations (was killed by D807 V2) === */
*, *::before, *::after { animation-play-state: running !important; }
[class*="card"], [class*="kpi"], [class*="pilier"], [class*="metric"], 
[class*="stat"], [class*="signal"], [class*="tile"], [class*="panel"],
[class*="widget"], [class*="dashboard"], [class*="recommendation"],
[class*="action"]:not(button), [class*="reasoning"],
section > div, main > div { 
  opacity: 1 !important; 
  visibility: visible !important; 
}

/* === Body: cream + DM Sans === */
html, html body {
  background: #faf7f5 !important;
  background-color: #faf7f5 !important;
  background-image: none !important;
  color: #1B1B1B !important;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
  -webkit-font-smoothing: antialiased !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  letter-spacing: -0.005em !important;
}

/* === Headings: DM Sans + dark === */
html body h1, html body h2, html body h3, html body h4, html body h5, html body h6 {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  color: #1B1B1B !important;
}
html body h1 { font-size: clamp(26px, 5vw, 50px) !important; line-height: 1.12 !important; }
html body h1 strong, html body h1 em { color: #3730A3 !important; font-weight: 400 !important; font-style: normal !important; }

/* === Text dark === */
html body p, html body span, html body div, html body li, html body td, html body th,
html body section *, html body article *, html body main *, html body aside *,
html body label, html body figcaption, html body strong, html body em {
  color: #1B1B1B !important;
}
html body [class*="muted"], html body [class*="secondary"], html body small,
html body [class*="caption"], html body [class*="subtitle"]:not(h1):not(h2),
html body .sub, html body .tagline {
  color: #555555 !important;
}

/* === Sections transparent (pas de fond noir derrière titres) === */
html body section, html body article, html body main, html body aside {
  background-color: transparent !important;
  background-image: none !important;
}

/* === NAV: cream translucent sticky === */
html body header, html body nav, html body [class*="navbar"],
html body [role="banner"], html body [class*="top-bar"], html body .n {
  background: rgba(250, 248, 245, 0.92) !important;
  background-color: rgba(250, 248, 245, 0.92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid #E8E2D9 !important;
  color: #1B1B1B !important;
}
html body header *, html body nav *, html body [class*="navbar"] * {
  color: #555555 !important;
  background-color: transparent !important;
}
html body header a, html body nav a, html body [class*="navbar"] a, html body .n a {
  color: #555555 !important;
  text-decoration: none !important;
  padding: 7px 14px !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  transition: 0.2s !important;
}
html body header a:hover, html body nav a:hover { color: #3730A3 !important; }
html body header [class*="logo"], html body nav [class*="logo"],
html body header [class*="brand"], html body nav [class*="brand"] {
  color: #1B1B1B !important;
}
html body header [class*="logo"] strong, html body nav [class*="brand"] b { color: #3730A3 !important; }

/* === Cards (demo-agents .ppc style): WHITE bg + beige border + soft shadow on hover === */
html body [class*="card"], html body [class*="panel"], html body [class*="tile"],
html body [class*="widget"]:not([class*="chat"]), html body [class*="modal"],
html body [class*="dashboard"], html body [class*="hub-card"], html body [class*="cockpit"],
html body [class*="kpi"], html body [class*="stat-card"], html body [class*="metric-card"],
html body [class*="signal-card"], html body [class*="indicator"], html body [class*="gauge"],
html body [class*="feed"], html body [class*="entry"], html body [class*="recommendation"],
html body [class*="action-item"], html body [class*="pred-"]:not([class*="navbar"]),
html body .ppc, html body .dc {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  background-image: none !important;
  color: #1B1B1B !important;
  border: 1px solid #E8E2D9 !important;
  border-radius: 16px !important;
  transition: 0.2s !important;
  padding: 20px !important;
}
html body [class*="card"]:hover, html body [class*="panel"]:hover, html body .ppc:hover {
  border-color: #6366F1 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.03) !important;
}

/* Card content */
html body [class*="card"] *, html body [class*="panel"] *,
html body [class*="kpi"] *, html body [class*="metric"] *,
html body [class*="signal"] *, html body [class*="recommendation"] *,
html body [class*="reasoning"] *, html body .ppc * {
  color: #1B1B1B !important;
}
html body [class*="card"] [class*="badge"], html body [class*="card"] [class*="pill"],
html body [class*="card"] [class*="tag"], html body [class*="card"] [class*="chip"] {
  color: revert; background-color: revert;
}

/* === KPI/Stat NUMBERS: large indigo === */
html body .kn, html body [class*="kpi"] [class*="number"],
html body [class*="kpi"] [class*="value"], html body [class*="stat"] [class*="number"],
html body [class*="metric"] strong:first-child, html body [class*="big-num"],
html body [class*="counter"] strong, html body [class*="figure-big"] {
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-size: 40px !important;
  line-height: 1 !important;
  letter-spacing: -0.03em !important;
  color: #3730A3 !important;
  font-weight: 700 !important;
}
html body .kl, html body [class*="kpi"] [class*="label"], html body [class*="stat"] [class*="label"] {
  font-size: 10px !important;
  color: #999999 !important;
  font-weight: 500 !important;
  margin-top: 3px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
}

/* === Buttons primary (indigo bg white text) === */
html body button.bp, html body .btn-primary, html body [class*="btn-primary"],
html body button[class*="primary"]:not([class*="text"]), 
html body a.btn-primary, html body a[class*="btn-primary"],
html body a.btn.primary, html body [class*="cta-primary"],
html body [class*="bp"]:not([class*="cabp"]) {
  background: #3730A3 !important;
  background-color: #3730A3 !important;
  color: #FFFFFF !important;
  padding: 12px 26px !important;
  border-radius: 14px !important;
  font: 500 14px 'DM Sans', system-ui, sans-serif !important;
  border: none !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: 0.25s !important;
  box-shadow: 0 2px 12px rgba(55, 48, 163, 0.2) !important;
}
html body button.bp:hover, html body .btn-primary:hover { transform: translateY(-1px) !important; }

/* === Buttons outline (transparent border) === */
html body button.bo, html body .btn-outline, html body [class*="btn-outline"],
html body a.btn-outline {
  background: transparent !important;
  color: #1B1B1B !important;
  border: 1.5px solid #E8E2D9 !important;
  padding: 12px 26px !important;
  border-radius: 14px !important;
  font: 500 14px 'DM Sans', system-ui, sans-serif !important;
}
html body button.bo:hover, html body .btn-outline:hover {
  border-color: #6366F1 !important;
  color: #3730A3 !important;
}

/* === Links indigo === */
html body a:not([class*="btn"]):not([class*="button"]):not(.close-x):not([class*="nav"]):not(header a):not(nav a) {
  color: #3730A3 !important;
  text-decoration: none !important;
}
html body a:hover { color: #6366F1 !important; }

/* === Code blocks === */
html body pre, html body code:not([class*="card"]) {
  background: #f5f1ec !important;
  color: #1B1B1B !important;
  border: 1px solid #E8E2D9 !important;
  border-radius: 10px !important;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', monospace !important;
  padding: 12px !important;
}

/* === Kill dark gradients inline === */
html body *[style*="linear-gradient"]:not(button):not(a):not([class*="logo"]):not([class*="badge"]):not(#d466-sticky-cta-bar):not(#d466-sticky-cta-bar *),
html body *[style*="rgba(10"]:not(button):not(a):not([class*="logo"]),
html body *[style*="rgba(14"]:not(button):not(a):not([class*="logo"]),
html body *[style*="rgba(20"]:not(button):not(a):not([class*="logo"]),
html body *[style*="background:#0"]:not(button),
html body *[style*="background-color:#0"]:not(button),
html body *[style*="background:#1"]:not(button),
html body *[style*="background-color:#1"]:not(button) {
  background: #FFFFFF !important;
  background-image: none !important;
  color: #1B1B1B !important;
}

/* === CTA banner stays purple === */
html body #d466-sticky-cta-bar, html body #d466-sticky-cta-bar * {
  color: #FFFFFF !important;
}
html body #d466-sticky-cta-bar {
  background: linear-gradient(90deg, #3730A3, #4F46E5) !important;
}
html body #d466-sticky-cta-bar a.cta-btn {
  color: #3730A3 !important;
  background: #FFFFFF !important;
}

/* === Pills/badges keep accent colors === */
html body [class*="pill"]:not(.cta-btn), html body [class*="badge"], html body [class*="chip"],
html body [class*="tag"]:not(html), html body [class*="status"] {
  color: revert; background-color: revert;
}

/* === Selection === */
html body ::selection { background: rgba(99, 102, 241, 0.15); }

/* === Kill black bands forbidden === */
html body header[style*="background:#0"], html body nav[style*="background:#0"],
html body header[style*="background:black"], html body nav[style*="background:black"] {
  background: rgba(250,248,245,0.92) !important;
  background-color: rgba(250,248,245,0.92) !important;
}

/* === KILL dark theme toggles === */
[data-theme="dark"], .dark, .dark-theme, .theme-dark, .night-mode {
  background: #faf7f5 !important; color: #1B1B1B !important; color-scheme: light !important;
}
button[class*="theme-toggle"], [class*="dark-switch"], [data-toggle="dark"] { display: none !important; }

/* === Pseudo-elements overlays off === */
*::before, *::after { 
  background-image: none !important; 
  filter: none !important; 
  backdrop-filter: none !important; 
}
* { backdrop-filter: none !important; }
html body header, html body nav { backdrop-filter: blur(16px) !important; }
[class*="overlay"]:not(#d466-sticky-cta-bar), [class*="backdrop"]:not(#d466-sticky-cta-bar) {
  background-image: none !important; opacity: 0 !important;
}

/* === Body padding for sticky pill === */
html body { padding-bottom: 80px !important; }

/* === Chat widgets above pill === */
[class*="chat-widget"], [class*="wevia-assistant"], [class*="whatsapp-btn"],
[class*="wevia-avatar"], [class*="wevia-live"], [class*="floating-chat"] {
  bottom: 90px !important;
}
