/*
 * Digisoul Inherited Pages Design Bridge
 * Scope: ONLY pages with body.dsx-inherited added by the MU plugin.
 * Do not target the homepage, AIFusionX templates, menus, or global Elementor library.
 */

body.dsx-inherited {
  --dsx-font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --dsx-bg: #DBD3FF;
  --dsx-ink: #050505;
  --dsx-muted: rgba(5, 5, 5, .68);
  --dsx-soft: rgba(255, 255, 255, .72);
  --dsx-soft-2: rgba(255, 255, 255, .52);
  --dsx-dark: #050505;
  --dsx-dark-2: #0B1020;
  --dsx-purple: #6904F2;
  --dsx-gold: #C9A86E;
  --dsx-border: rgba(5, 5, 5, .12);
  --dsx-border-light: rgba(255, 255, 255, .18);
  --dsx-radius-lg: 32px;
  --dsx-radius-md: 22px;
  --dsx-radius-pill: 999px;
  font-family: var(--dsx-font);
  background: var(--dsx-bg);
}

body.dsx-inherited :where(h1, h2, h3, h4, h5, h6, p, li, a, button, input, select, textarea, label) {
  font-family: var(--dsx-font);
}

body.dsx-inherited :where(h1, h2) {
  letter-spacing: clamp(-2.4px, -0.04em, -1px);
  font-weight: 500;
}

/*
 * V2 stronger normalization.
 * Reason: inherited Elementor pages contain inline/old-theme rules with
 * Playfair/Cormorant/Montserrat and page-level colors. These overrides are
 * still scoped to body.dsx-inherited, never the AIFusionX homepage/theme shell.
 */
body.dsx-inherited :where(
  h1, h2, h3, h4, h5, h6,
  .elementor-heading-title,
  .elementor-widget-heading .elementor-heading-title,
  .wp-block-heading,
  .dgs-pl-portal h1,
  .dgs-pl-portal h2,
  .dgs-pl-portal h3
) {
  font-family: var(--dsx-font) !important;
  font-weight: 500 !important;
  letter-spacing: clamp(-2.8px, -0.045em, -0.6px) !important;
  line-height: 1.05 !important;
  text-transform: none;
}

body.dsx-inherited :where(
  p, li, span, small,
  .elementor-widget-text-editor,
  .elementor-widget-text-editor *,
  .wp-block-paragraph,
  .dgs-pl-portal,
  .dgs-pl-portal *
) {
  font-family: var(--dsx-font) !important;
}

body.dsx-inherited :where(.elementor-heading-title, h1) {
  font-size: clamp(42px, 6.4vw, 92px) !important;
}

body.dsx-inherited :where(h2, .elementor-widget-heading h2.elementor-heading-title) {
  font-size: clamp(32px, 4.4vw, 64px) !important;
}

body.dsx-inherited :where(h3, .elementor-widget-heading h3.elementor-heading-title) {
  font-size: clamp(24px, 2.5vw, 36px) !important;
}

body.dsx-inherited :where(p, li, .elementor-widget-text-editor) {
  font-size: clamp(16px, 1.05vw, 18px) !important;
  line-height: 1.55 !important;
}

/* Make inherited dark pages feel like the new AIFusionX dark/lavender system. */
body.dsx-ai4x,
body.dsx-ai4x-programme,
body.dsx-diwan,
body.dsx-jafaros {
  background:
    radial-gradient(circle at 0% 0%, rgba(219, 211, 255, .18), transparent 28%),
    linear-gradient(135deg, #080A13 0%, #101A3A 46%, #070A12 100%) !important;
}

body.dsx-ai4x :where(main, #main, #main-content, .main-container),
body.dsx-ai4x-programme :where(main, #main, #main-content, .main-container),
body.dsx-diwan :where(main, #main, #main-content, .main-container),
body.dsx-jafaros :where(main, #main, #main-content, .main-container) {
  background: transparent !important;
}

body.dsx-ai4x :where(h1, h2, h3, .elementor-heading-title),
body.dsx-ai4x-programme :where(h1, h2, h3, .elementor-heading-title),
body.dsx-diwan :where(h1, h2, h3, .elementor-heading-title),
body.dsx-jafaros :where(h1, h2, h3, .elementor-heading-title) {
  color: #F7F7F7 !important;
}

body.dsx-ai4x :where(p, li, .elementor-widget-text-editor),
body.dsx-ai4x-programme :where(p, li, .elementor-widget-text-editor),
body.dsx-diwan :where(p, li, .elementor-widget-text-editor),
body.dsx-jafaros :where(p, li, .elementor-widget-text-editor) {
  color: rgba(247, 247, 247, .78) !important;
}

body.dsx-ai4x :where(section, .elementor-section, .elementor-container, .elementor-widget-container),
body.dsx-ai4x-programme :where(section, .elementor-section, .elementor-container, .elementor-widget-container),
body.dsx-diwan :where(section, .elementor-section, .elementor-container, .elementor-widget-container) {
  border-color: rgba(255, 255, 255, .12);
}

/* Light form/survey pages should look like the new lavender AIFusionX shell. */
body.dsx-ai4x-survey {
  background:
    radial-gradient(circle at 20% 0%, rgba(105, 4, 242, .16), transparent 28%),
    #DBD3FF !important;
}

body.dsx-ai4x-survey :where(h1, h2, h3, .elementor-heading-title) {
  color: #050505 !important;
}

body.dsx-ai4x-survey :where(p, li, .elementor-widget-text-editor) {
  color: rgba(5, 5, 5, .72) !important;
}

body.dsx-ai4x-survey :where(.fluentform, form) {
  color: #050505 !important;
}

/* =========================================================
   V4 REMEDIATION PASS
   Scope remains body.dsx-inherited only.
   Goal: readability, visible CTAs, card surfaces, form contrast.
   ========================================================= */

body.dsx-inherited {
  color-scheme: light;
}

/* Dark inherited pages: normalize text contrast everywhere except explicitly light cards. */
body.dsx-ai4x,
body.dsx-ai4x-programme,
body.dsx-diwan,
body.dsx-jafaros,
body.dsx-prompt-library {
  --dsx-page-text: #F7F7F7;
  --dsx-page-muted: rgba(247,247,247,.78);
  --dsx-page-subtle: rgba(247,247,247,.62);
}

body.dsx-ai4x :is(p, li, span, label, small, strong, em, div),
body.dsx-ai4x-programme :is(p, li, span, label, small, strong, em, div),
body.dsx-diwan :is(p, li, span, label, small, strong, em, div),
body.dsx-jafaros :is(p, li, span, label, small, strong, em, div) {
  color: inherit;
}

body.dsx-ai4x :is(.elementor-widget-text-editor, .elementor-widget-text-editor *, .elementor-icon-list-text, .elementor-counter-title, .elementor-counter-number, .elementor-tab-title, .elementor-tab-content),
body.dsx-ai4x-programme :is(.elementor-widget-text-editor, .elementor-widget-text-editor *, .elementor-icon-list-text, .elementor-counter-title, .elementor-counter-number, .elementor-tab-title, .elementor-tab-content),
body.dsx-diwan :is(.elementor-widget-text-editor, .elementor-widget-text-editor *, .elementor-icon-list-text, .elementor-counter-title, .elementor-counter-number, .elementor-tab-title, .elementor-tab-content),
body.dsx-jafaros :is(.elementor-widget-text-editor, .elementor-widget-text-editor *, .elementor-icon-list-text, .elementor-counter-title, .elementor-counter-number, .elementor-tab-title, .elementor-tab-content) {
  color: var(--dsx-page-muted) !important;
}

body.dsx-ai4x :is(.elementor-heading-title, h1, h2, h3, h4),
body.dsx-ai4x-programme :is(.elementor-heading-title, h1, h2, h3, h4),
body.dsx-diwan :is(.elementor-heading-title, h1, h2, h3, h4),
body.dsx-jafaros :is(.elementor-heading-title, h1, h2, h3, h4) {
  color: var(--dsx-page-text) !important;
  text-shadow: 0 10px 34px rgba(0,0,0,.28);
}

/* Light cards/panels inside dark pages should use dark text. */
body.dsx-inherited :is(
  [style*="background-color: #fff"],
  [style*="background-color:#fff"],
  [style*="background-color: white"],
  [style*="background: #fff"],
  [style*="background:#fff"],
  [style*="background-color: rgb(255"],
  .has-background[style*="255"],
  .ff-el-group,
  .fluentform,
  .woocommerce-message,
  .woocommerce-info,
  .woocommerce-error
) :is(h1,h2,h3,h4,h5,h6,p,li,span,label,small,strong,em,div) {
  color: #050505 !important;
  text-shadow: none !important;
}

/* Buttons and links: make inherited CTAs visible and consistent. */
body.dsx-inherited :is(
  .elementor-button,
  .elementor-button-link,
  .wp-block-button__link,
  button,
  input[type="submit"],
  .ff-btn-submit,
  .tutor-btn,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button,
  a[class*="btn"],
  a[class*="button"]
) {
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 13px 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border-radius: 999px !important;
  background: #050505 !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.22) !important;
  text-decoration: none !important;
}

body.dsx-inherited :is(
  .elementor-button,
  .elementor-button-link,
  .wp-block-button__link,
  button,
  input[type="submit"],
  .ff-btn-submit,
  .tutor-btn,
  .woocommerce a.button,
  .woocommerce button.button,
  .woocommerce input.button,
  a[class*="btn"],
  a[class*="button"]
) :is(span, strong, em, i, svg) {
  color: inherit !important;
  fill: currentColor !important;
}

body.dsx-ai4x :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn),
body.dsx-ai4x-programme :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn),
body.dsx-diwan :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn),
body.dsx-jafaros :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn),
body.dsx-prompt-library :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn) {
  background: rgba(5,5,5,.86) !important;
  color: #FFFFFF !important;
  border-color: rgba(201,168,110,.42) !important;
}

body.dsx-inherited :is(.elementor-button:hover, .wp-block-button__link:hover, button:hover, input[type="submit"]:hover, .ff-btn-submit:hover, .tutor-btn:hover, .woocommerce a.button:hover) {
  background: #6904F2 !important;
  color: #FFFFFF !important;
  border-color: #6904F2 !important;
}

/* Survey/form page readability. */
body.dsx-ai4x-survey :is(.elementor-section, .elementor-container, .elementor-widget-wrap) {
  color: #050505;
}

body.dsx-ai4x-survey :is(.fluentform, form, .ff-el-group) {
  background: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(5,5,5,.14) !important;
  box-shadow: 0 24px 70px rgba(20,12,60,.14) !important;
}

body.dsx-ai4x-survey :is(input, select, textarea) {
  background: #FFFFFF !important;
  color: #050505 !important;
  border-color: rgba(5,5,5,.22) !important;
}

body.dsx-ai4x-survey :is(.ff-el-form-check-label, .ff-el-input--label, .ff-el-input--content, .ff-el-group label, .ff-el-help-message) {
  color: #050505 !important;
}

/* Prompt Library contrast pass. */
body.dsx-prompt-library .dgs-pl-portal {
  color: #F7F7F7 !important;
}

body.dsx-prompt-library .dgs-pl-portal :is(.dgs-pl-card, .dgs-pl-prompt-card, .dgs-pl-panel, .dgs-pl-filter-group) {
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: #F7F7F7 !important;
}

body.dsx-prompt-library .dgs-pl-portal :is(.dgs-pl-card *, .dgs-pl-prompt-card *, .dgs-pl-panel *) {
  color: inherit;
}

body.dsx-prompt-library .dgs-pl-portal :is(input, select, textarea) {
  background: #FFFFFF !important;
  color: #050505 !important;
}

/* Hide broken inherited images cleanly after JS flags them. */
body.dsx-inherited img[data-dsx-broken="1"] {
  display: none !important;
}

/* Reduce false overlaps caused by tight old layouts. */
body.dsx-inherited :is(.elementor-widget, .elementor-widget-container) {
  overflow-wrap: anywhere;
}

body.dsx-inherited :is(.elementor-column, .elementor-widget-wrap) {
  min-width: 0;
}

@media (max-width: 767px) {
  body.dsx-inherited :is(.elementor-heading-title, h1) {
    font-size: clamp(34px, 11vw, 48px) !important;
    line-height: 1.08 !important;
    letter-spacing: -1.4px !important;
  }
  body.dsx-inherited :is(h2) {
    font-size: clamp(28px, 8vw, 40px) !important;
    line-height: 1.12 !important;
  }
  body.dsx-inherited :is(p, li, .elementor-widget-text-editor) {
    font-size: 16px !important;
  }
}

/* Stronger AIFusionX CTA treatment. */
body.dsx-inherited :where(
  .elementor-button,
  .wp-block-button__link,
  button,
  input[type="submit"],
  .ff-btn-submit,
  .tutor-btn,
  .woocommerce a.button,
  .woocommerce button.button
) {
  background: #050505 !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.18) !important;
}

body.dsx-inherited :where(
  .elementor-button:hover,
  .wp-block-button__link:hover,
  button:hover,
  input[type="submit"]:hover,
  .ff-btn-submit:hover,
  .tutor-btn:hover,
  .woocommerce a.button:hover,
  .woocommerce button.button:hover
) {
  background: #6904F2 !important;
  color: #FFFFFF !important;
}

body.dsx-inherited :where(p, li) {
  line-height: 1.55;
}

body.dsx-inherited :where(a) {
  text-underline-offset: .16em;
}

/* Primary CTA normalization - AIFusionX-like pill buttons. */
body.dsx-inherited :where(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn, .woocommerce a.button, .woocommerce button.button) {
  border-radius: var(--dsx-radius-pill) !important;
  font-family: var(--dsx-font) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

body.dsx-inherited :where(.elementor-button:hover, .wp-block-button__link:hover, button:hover, input[type="submit"]:hover, .ff-btn-submit:hover, .tutor-btn:hover, .woocommerce a.button:hover, .woocommerce button.button:hover) {
  transform: translateY(-1px);
}

/* Form field normalization for inherited survey/lead pages only. */
body.dsx-inherited :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  border-radius: 14px !important;
  border: 1px solid var(--dsx-border) !important;
  min-height: 44px;
}

body.dsx-inherited :where(input:focus, textarea:focus, select:focus) {
  outline: 2px solid rgba(105, 4, 242, .28) !important;
  outline-offset: 2px;
  border-color: rgba(105, 4, 242, .55) !important;
}

/* Fluent Forms surfaces. */
body.dsx-ai4x-survey .fluentform,
body.dsx-webinar .fluentform,
body.dsx-lead .fluentform {
  background: var(--dsx-soft);
  border: 1px solid var(--dsx-border);
  border-radius: var(--dsx-radius-lg);
  padding: clamp(20px, 4vw, 40px);
  box-shadow: 0 18px 50px rgba(5, 5, 5, .08);
}

body.dsx-ai4x-survey .fluentform label,
body.dsx-webinar .fluentform label,
body.dsx-lead .fluentform label {
  color: var(--dsx-ink);
  font-weight: 600;
}

/* Prompt Library: keep plugin structure, only align surfaces and controls. */
body.dsx-prompt-library .dgs-pl-portal,
body.dsx-prompt-library .dgs-pl-stage {
  font-family: var(--dsx-font) !important;
}

body.dsx-prompt-library .dgs-pl-portal {
  background:
    radial-gradient(circle at 20% 0%, rgba(105, 4, 242, .22), transparent 34%),
    linear-gradient(135deg, #080B16 0%, #0A244A 48%, #111425 100%) !important;
}

body.dsx-prompt-library :where(.dgs-pl-card, .dgs-pl-panel, .dgs-pl-filter-group, .dgs-pl-modal, .dgs-pl-paywall) {
  border-radius: var(--dsx-radius-lg) !important;
  border-color: var(--dsx-border-light) !important;
}

body.dsx-prompt-library :where(.dgs-pl-btn, .dgs-pl-button, .dgs-pl-chip, .dgs-pl-pill) {
  border-radius: var(--dsx-radius-pill) !important;
}

/* AI4X inherited pages: smoother bridge into AIFusionX. */
body.dsx-ai4x-survey,
body.dsx-webinar,
body.dsx-lead,
body.dsx-pricing {
  background:
    radial-gradient(circle at 8% 0%, rgba(105, 4, 242, .14), transparent 28%),
    var(--dsx-bg);
}

body.dsx-ai4x :where(.elementor-widget-container, .wp-block-group, .wp-block-columns),
body.dsx-ai4x-programme :where(.elementor-widget-container, .wp-block-group, .wp-block-columns),
body.dsx-diwan :where(.elementor-widget-container, .wp-block-group, .wp-block-columns) {
  border-radius: inherit;
}

/* Keep dark legacy sections readable while adopting the AIFusionX font. */
body.dsx-inherited :where([style*="background"], .dark, .is-style-dark) :where(p, li, h1, h2, h3, h4) {
  text-wrap: pretty;
}

/* JafarOS: preserve custom world, only normalize type and keep mascot above AIFusionX shell. */
body.dsx-jafaros {
  background: #090D18;
}

body.dsx-jafaros #jafaros-page {
  overflow: visible !important;
}

body.dsx-jafaros #robotWrap.robot-companion {
  z-index: 99999 !important;
}

body.dsx-jafaros :where(button, .btn, .elementor-button, a[class*="button"]) {
  border-radius: var(--dsx-radius-pill) !important;
}

@media (max-width: 767px) {
  body.dsx-inherited :where(h1) {
    letter-spacing: -1.2px;
  }
  body.dsx-inherited :where(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn) {
    min-height: 44px;
  }
  body.dsx-ai4x-survey .fluentform,
  body.dsx-webinar .fluentform,
  body.dsx-lead .fluentform {
    padding: 18px;
    border-radius: 22px;
  }
}

/*
 * V3 high-specificity overrides.
 * Some inherited Elementor pages ship page-level CSS with strong selectors and
 * legacy serif fonts. These selectors intentionally avoid :where() so they win.
 */
body.dsx-inherited.dsx-ai4x h1,
body.dsx-inherited.dsx-ai4x h2,
body.dsx-inherited.dsx-ai4x h3,
body.dsx-inherited.dsx-ai4x .elementor-heading-title,
body.dsx-inherited.dsx-ai4x-programme h1,
body.dsx-inherited.dsx-ai4x-programme h2,
body.dsx-inherited.dsx-ai4x-programme h3,
body.dsx-inherited.dsx-ai4x-programme .elementor-heading-title,
body.dsx-inherited.dsx-ai4x-survey h1,
body.dsx-inherited.dsx-ai4x-survey h2,
body.dsx-inherited.dsx-ai4x-survey h3,
body.dsx-inherited.dsx-ai4x-survey .elementor-heading-title,
body.dsx-inherited.dsx-prompt-library h1,
body.dsx-inherited.dsx-prompt-library h2,
body.dsx-inherited.dsx-prompt-library h3,
body.dsx-inherited.dsx-prompt-library .elementor-heading-title,
body.dsx-inherited.dsx-diwan h1,
body.dsx-inherited.dsx-diwan h2,
body.dsx-inherited.dsx-diwan h3,
body.dsx-inherited.dsx-diwan .elementor-heading-title,
body.dsx-inherited.dsx-jafaros h1,
body.dsx-inherited.dsx-jafaros h2,
body.dsx-inherited.dsx-jafaros h3,
body.dsx-inherited.dsx-jafaros .elementor-heading-title {
  font-family: var(--dsx-font) !important;
  font-weight: 500 !important;
  letter-spacing: clamp(-3px, -0.045em, -0.75px) !important;
  line-height: 1.05 !important;
}

body.dsx-inherited.dsx-ai4x h1,
body.dsx-inherited.dsx-ai4x .elementor-widget-heading h1.elementor-heading-title,
body.dsx-inherited.dsx-ai4x-programme h1,
body.dsx-inherited.dsx-ai4x-programme .elementor-widget-heading h1.elementor-heading-title,
body.dsx-inherited.dsx-diwan h1,
body.dsx-inherited.dsx-diwan .elementor-widget-heading h1.elementor-heading-title,
body.dsx-inherited.dsx-jafaros h1,
body.dsx-inherited.dsx-jafaros .elementor-widget-heading h1.elementor-heading-title {
  font-size: clamp(50px, 7vw, 88px) !important;
}

body.dsx-inherited.dsx-ai4x-survey h1,
body.dsx-inherited.dsx-ai4x-survey .elementor-widget-heading h1.elementor-heading-title {
  font-size: clamp(38px, 5.2vw, 64px) !important;
}

body.dsx-inherited.dsx-prompt-library h1,
body.dsx-inherited.dsx-prompt-library .elementor-widget-heading h1.elementor-heading-title,
body.dsx-inherited.dsx-prompt-library .dgs-pl-portal h1 {
  font-size: clamp(34px, 4vw, 54px) !important;
}

body.dsx-inherited.dsx-ai4x p,
body.dsx-inherited.dsx-ai4x li,
body.dsx-inherited.dsx-ai4x .elementor-widget-text-editor,
body.dsx-inherited.dsx-ai4x .elementor-widget-text-editor *,
body.dsx-inherited.dsx-ai4x-programme p,
body.dsx-inherited.dsx-ai4x-programme li,
body.dsx-inherited.dsx-ai4x-programme .elementor-widget-text-editor,
body.dsx-inherited.dsx-ai4x-programme .elementor-widget-text-editor *,
body.dsx-inherited.dsx-ai4x-survey p,
body.dsx-inherited.dsx-ai4x-survey li,
body.dsx-inherited.dsx-ai4x-survey .elementor-widget-text-editor,
body.dsx-inherited.dsx-ai4x-survey .elementor-widget-text-editor *,
body.dsx-inherited.dsx-diwan p,
body.dsx-inherited.dsx-diwan li,
body.dsx-inherited.dsx-diwan .elementor-widget-text-editor,
body.dsx-inherited.dsx-diwan .elementor-widget-text-editor *,
body.dsx-inherited.dsx-jafaros p,
body.dsx-inherited.dsx-jafaros li,
body.dsx-inherited.dsx-jafaros .elementor-widget-text-editor,
body.dsx-inherited.dsx-jafaros .elementor-widget-text-editor * {
  font-family: var(--dsx-font) !important;
  font-size: clamp(16px, 1.05vw, 18px) !important;
  line-height: 1.55 !important;
  font-weight: 400 !important;
}

/* Preserve readable light-on-dark legacy content while moving typography to AIFusionX. */
body.dsx-inherited.dsx-ai4x h1,
body.dsx-inherited.dsx-ai4x h2,
body.dsx-inherited.dsx-ai4x h3,
body.dsx-inherited.dsx-ai4x .elementor-heading-title,
body.dsx-inherited.dsx-ai4x-programme h1,
body.dsx-inherited.dsx-ai4x-programme h2,
body.dsx-inherited.dsx-ai4x-programme h3,
body.dsx-inherited.dsx-ai4x-programme .elementor-heading-title,
body.dsx-inherited.dsx-diwan h1,
body.dsx-inherited.dsx-diwan h2,
body.dsx-inherited.dsx-diwan h3,
body.dsx-inherited.dsx-diwan .elementor-heading-title {
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-ai4x-survey h1,
body.dsx-inherited.dsx-ai4x-survey h2,
body.dsx-inherited.dsx-ai4x-survey h3,
body.dsx-inherited.dsx-ai4x-survey .elementor-heading-title {
  color: #050505 !important;
}

/* =========================================================
   V5 PAGE-SPECIFIC READABILITY FIXES
   Scoped to inherited/imported pages only.
   ========================================================= */

/* Programme and product landing pages stay dark. Earlier broad light-shell rules
   are intentionally overridden here so inherited sections do not become
   black-on-dark or white-on-lavender by accident. */
body.dsx-inherited.dsx-ai4x,
body.dsx-inherited.dsx-ai4x-programme,
body.dsx-inherited.dsx-diwan,
body.dsx-inherited.dsx-jafaros {
  background:
    radial-gradient(circle at 0% 0%, rgba(219, 211, 255, .18), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(105, 4, 242, .18), transparent 28%),
    linear-gradient(135deg, #080A13 0%, #101A3A 46%, #070A12 100%) !important;
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-ai4x :is(.lede, .sub, .subtitle, .cine-sub, .ff-sub, .hero-subtitle, .hero-copy, .section-copy, .elementor-widget-text-editor, .elementor-icon-list-text),
body.dsx-inherited.dsx-ai4x-programme :is(.lede, .sub, .subtitle, .cine-sub, .ff-sub, .hero-subtitle, .hero-copy, .section-copy, .elementor-widget-text-editor, .elementor-icon-list-text),
body.dsx-inherited.dsx-diwan :is(.lede, .sub, .subtitle, .cine-sub, .ff-sub, .hero-subtitle, .hero-copy, .section-copy, .elementor-widget-text-editor, .elementor-icon-list-text),
body.dsx-inherited.dsx-jafaros :is(.lede, .sub, .subtitle, .cine-sub, .ff-sub, .hero-subtitle, .hero-copy, .section-copy, .elementor-widget-text-editor, .elementor-icon-list-text) {
  color: rgba(247,247,247,.82) !important;
  text-shadow: 0 8px 26px rgba(0,0,0,.22);
}

body.dsx-inherited.dsx-ai4x :is(.eyebrow, .eye, .kicker, .label, .tag, .badge),
body.dsx-inherited.dsx-ai4x-programme :is(.eyebrow, .eye, .kicker, .label, .tag, .badge),
body.dsx-inherited.dsx-diwan :is(.eyebrow, .eye, .kicker, .label, .tag, .badge),
body.dsx-inherited.dsx-jafaros :is(.eyebrow, .eye, .kicker, .label, .tag, .badge) {
  color: #C9A86E !important;
}

/* Light cards within dark pages must not inherit white text. */
body.dsx-inherited :is(.white-card, .light-card, .pricing-card, .course-card, .programme-card, .survey-card, .ff-el-group, .fluentform, [class*="card"][style*="255"], [class*="panel"][style*="255"]) {
  color: #050505 !important;
}

body.dsx-inherited :is(.white-card, .light-card, .pricing-card, .course-card, .programme-card, .survey-card, .ff-el-group, .fluentform, [class*="card"][style*="255"], [class*="panel"][style*="255"]) :is(h1,h2,h3,h4,h5,h6,p,li,span,small,strong,em,label,div) {
  color: inherit !important;
  text-shadow: none !important;
}

/* Pricing is a light AIFusionX-style page, not the dark prompt-library portal. */
body.dsx-inherited.dsx-pricing {
  background:
    radial-gradient(circle at 18% 0%, rgba(105,4,242,.16), transparent 30%),
    #DBD3FF !important;
  color: #050505 !important;
}

body.dsx-inherited.dsx-pricing :is(h1,h2,h3,h4,.elementor-heading-title,p,li,span,small,strong,em,label,div) {
  color: #050505 !important;
  text-shadow: none !important;
}

body.dsx-inherited.dsx-pricing :is(.dgs-pl-portal, .dgs-pl-stage) {
  background: transparent !important;
  color: #050505 !important;
}

body.dsx-inherited.dsx-pricing :is(.dgs-pl-card, .dgs-pl-panel, .dgs-pl-filter-group, .dgs-pl-paywall, .elementor-widget-container) {
  border-color: rgba(5,5,5,.12) !important;
}

body.dsx-inherited.dsx-pricing :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .dgs-pl-btn, .dgs-pl-button, .woocommerce a.button) {
  background: #050505 !important;
  color: #F7F7F7 !important;
  border-color: rgba(5,5,5,.16) !important;
}

/* Prompt Library portal stays dark, but inner controls remain readable. */
body.dsx-inherited.dsx-prompt-library:not(.dsx-pricing) {
  background:
    radial-gradient(circle at 20% 0%, rgba(105, 4, 242, .22), transparent 34%),
    linear-gradient(135deg, #080B16 0%, #0A244A 48%, #111425 100%) !important;
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-prompt-library:not(.dsx-pricing) :is(.dgs-pl-portal, .dgs-pl-stage, .dgs-pl-card, .dgs-pl-panel, .dgs-pl-filter-group, .dgs-pl-paywall) {
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-prompt-library:not(.dsx-pricing) :is(.dgs-pl-portal, .dgs-pl-stage, .dgs-pl-card, .dgs-pl-panel, .dgs-pl-filter-group, .dgs-pl-paywall) :is(h1,h2,h3,h4,p,li,span,small,strong,em,label,div) {
  color: inherit !important;
}

body.dsx-inherited.dsx-prompt-library:not(.dsx-pricing) :is(input, select, textarea, option) {
  background: #F7F7F7 !important;
  color: #050505 !important;
}

/* Button text should never render as invisible or washed-out. */
body.dsx-inherited :is(.elementor-button, .elementor-button *, .wp-block-button__link, .wp-block-button__link *, button, button *, input[type="submit"], .ff-btn-submit, .ff-btn-submit *, .tutor-btn, .tutor-btn *, .dgs-pl-btn, .dgs-pl-btn *, .dgs-pl-button, .dgs-pl-button *) {
  color: #F7F7F7 !important;
  text-shadow: none !important;
}

body.dsx-inherited :is(.elementor-button, .wp-block-button__link, button, input[type="submit"], .ff-btn-submit, .tutor-btn, .dgs-pl-btn, .dgs-pl-button) {
  border-radius: 999px !important;
  background: #050505 !important;
  border: 1px solid rgba(201,168,110,.34) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.22) !important;
}

/* =========================================================
   V6 TARGETED VISUAL QA FIXES
   Based on remediation2 screenshots and element inspection.
   ========================================================= */

body.dsx-inherited :is(header, .site-header, .elementor-location-header, [data-elementor-type="header"]) {
  color: #050505 !important;
}

body.dsx-inherited :is(header, .site-header, .elementor-location-header, [data-elementor-type="header"]) :is(a, span, li, p, div, button, .e-n-menu-title, .e-n-menu-title-text) {
  color: #050505 !important;
  text-shadow: none !important;
}

body.dsx-inherited :is(header, .site-header, .elementor-location-header, [data-elementor-type="header"]) :is(.elementor-button, button, a[class*="button"]) {
  background: #050505 !important;
  color: #F7F7F7 !important;
  border-color: rgba(5,5,5,.14) !important;
}

body.dsx-inherited :is(header, .site-header, .elementor-location-header, [data-elementor-type="header"]) :is(.elementor-button *, button *, a[class*="button"] *) {
  color: #F7F7F7 !important;
}

body.dsx-inherited :is(.elementor-button, .wp-block-button__link, button, .tutor-btn, .ff-btn-submit) :is(.ds-price, .ds-price *, .ds-price__label, .ds-price__amount) {
  color: #F7F7F7 !important;
}

body.dsx-inherited :is(.pricing-card, .course-card, .programme-card, .white-card, .light-card) :is(.ds-price, .ds-price *, .ds-price__label, .ds-price__amount) {
  color: #050505 !important;
}

body.dsx-inherited.dsx-diwan :is(.hero-eyebrow, .hero-secondary, .countdown__lbl, .countdown__unit, .num) {
  color: #C9A86E !important;
}

body.dsx-inherited.dsx-jafaros :is(.cta-pri, .cta, a.cta-pri, a.cta, .btn, .btn *) {
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-jafaros :is(.cta-pri, .cta, a.cta-pri, a.cta, .btn) {
  background: #050505 !important;
  border: 1px solid rgba(201,168,110,.42) !important;
  border-radius: 999px !important;
}

body.dsx-inherited.dsx-ai4x-programme :is(.cmp-check, .cmp-cross, [class*="cmp-"], [class*="comparison"], [class*="criterion"]) {
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-ai4x-programme :is(table, .table, [class*="comparison"], [class*="matrix"]) :is(th, td, span, p, li, div) {
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-ai4x-programme :is(.fluentform, form) :is(label, .ff-el-form-check-label, .ff-el-input--label, .ff-el-help-message) {
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-ai4x-programme :is(.fluentform, form) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  background: #F7F7F7 !important;
  color: #050505 !important;
}

body.dsx-inherited.dsx-ai4x-survey :is(.chip, .seal-text, .iso-text, .phos, .meta, .eyebrow, a) {
  color: #050505 !important;
}

body.dsx-inherited.dsx-ai4x-survey :is(.chip, .phos) {
  background: rgba(5,5,5,.08) !important;
  border-color: rgba(5,5,5,.16) !important;
}

body.dsx-inherited img[src=""],
body.dsx-inherited img:not([src]) {
  display: none !important;
}

/* Mobile: avoid large old landing headings colliding with adjacent copy. */
@media (max-width: 767px) {
  body.dsx-inherited.dsx-ai4x h1,
  body.dsx-inherited.dsx-ai4x-programme h1,
  body.dsx-inherited.dsx-diwan h1,
  body.dsx-inherited.dsx-jafaros h1 {
    font-size: clamp(34px, 10vw, 48px) !important;
    line-height: 1.08 !important;
  }
  body.dsx-inherited :is(.elementor-section, .elementor-container, .elementor-widget-wrap) {
    min-width: 0 !important;
  }
}

/* =========================================================
   V7 SHELL GUARDRAILS
   Prevent inherited-page harmonization from distorting the
   AIFusionX global header/footer on V2 draft previews.
   ========================================================= */

body.dsx-inherited :is(
  header,
  footer,
  .site-header,
  .site-footer,
  .elementor-location-header,
  .elementor-location-footer,
  [data-elementor-type="header"],
  [data-elementor-type="footer"]
),
body.dsx-inherited :is(
  header,
  footer,
  .site-header,
  .site-footer,
  .elementor-location-header,
  .elementor-location-footer,
  [data-elementor-type="header"],
  [data-elementor-type="footer"]
) * {
  font-family: "Instrument Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: normal !important;
  line-height: normal !important;
  text-transform: none !important;
  text-shadow: none !important;
  transform: none;
}

body.dsx-inherited :is(
  header,
  .site-header,
  .elementor-location-header,
  [data-elementor-type="header"]
) {
  background: #F7F7F7 !important;
  color: #050505 !important;
  min-height: auto !important;
}

body.dsx-inherited :is(
  footer,
  .site-footer,
  .elementor-location-footer,
  [data-elementor-type="footer"]
) {
  background: #050505 !important;
  color: #F7F7F7 !important;
  min-height: auto !important;
  overflow: hidden !important;
}

body.dsx-inherited :is(
  header,
  footer,
  .site-header,
  .site-footer,
  .elementor-location-header,
  .elementor-location-footer,
  [data-elementor-type="header"],
  [data-elementor-type="footer"]
) :is(h1,h2,h3,h4,h5,h6,.elementor-heading-title) {
  font-size: inherit !important;
  line-height: inherit !important;
  letter-spacing: normal !important;
  color: inherit !important;
  text-shadow: none !important;
}

body.dsx-inherited :is(
  header,
  .site-header,
  .elementor-location-header,
  [data-elementor-type="header"]
) :is(a,span,li,p,div,button,.e-n-menu-title,.e-n-menu-title-text) {
  color: #050505 !important;
  font-size: inherit !important;
}

body.dsx-inherited :is(
  footer,
  .site-footer,
  .elementor-location-footer,
  [data-elementor-type="footer"]
) :is(a,span,li,p,div,button,.elementor-heading-title) {
  color: inherit !important;
  font-size: inherit !important;
}

body.dsx-inherited :is(
  header,
  .site-header,
  .elementor-location-header,
  [data-elementor-type="header"]
) :is(.elementor-button,button,a[class*="button"]) {
  min-height: auto !important;
  padding: 12px 20px !important;
  border-radius: 999px !important;
}

body.dsx-inherited :is(
  footer,
  .site-footer,
  .elementor-location-footer,
  [data-elementor-type="footer"]
) :is(.elementor-button,button,a[class*="button"]) {
  min-height: auto !important;
  padding: 12px 20px !important;
}

/* =========================================================
   V8 QA REMEDIATION
   Fixes: broken header controls, enlarged footer controls,
   phone country selector treated as CTA, Data Analytics hero metrics.
   ========================================================= */

body.dsx-inherited :is(
  header,
  .site-header,
  .elementor-location-header,
  [data-elementor-type="header"]
) :is(.e-n-menu-dropdown-icon, button.e-n-menu-dropdown-icon) {
  width: 7px !important;
  height: 7px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  border-radius: 0 !important;
}

@media (min-width: 1025px) {
  body.dsx-inherited :is(
    header,
    .site-header,
    .elementor-location-header,
    [data-elementor-type="header"]
  ) .e-n-menu-toggle {
    display: none !important;
  }
}

body.dsx-inherited :is(
  footer,
  .site-footer,
  .elementor-location-footer,
  [data-elementor-type="footer"]
) :is(.e-n-menu-dropdown-icon, .e-n-menu-toggle, button.e-n-menu-dropdown-icon) {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Fluent Forms phone selector is implemented as a button in newer intl-tel-input;
   undo inherited CTA styling specifically inside phone fields. */
body.dsx-inherited .fluentform :is(.iti__selected-country, button.iti__selected-country, .iti__selected-flag, button.iti__selected-flag),
body.dsx-inherited .ff-el-group :is(.iti__selected-country, button.iti__selected-country, .iti__selected-flag, button.iti__selected-flag) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-width: 88px !important;
  width: auto !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 12px !important;
  background: rgba(5,5,5,.045) !important;
  color: #050505 !important;
  border: 0 !important;
  border-right: 1px solid rgba(5,5,5,.14) !important;
  box-shadow: none !important;
  border-radius: 10px 0 0 10px !important;
}

body.dsx-inherited .fluentform :is(.iti__selected-country, .iti__selected-country *, .iti__selected-country-primary, .iti__selected-country-primary *, .iti__selected-dial-code),
body.dsx-inherited .ff-el-group :is(.iti__selected-country, .iti__selected-country *, .iti__selected-country-primary, .iti__selected-country-primary *, .iti__selected-dial-code) {
  color: #050505 !important;
  fill: currentColor !important;
  font-family: "Instrument Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

body.dsx-inherited .fluentform :is(.iti__dropdown-content, .iti__country-list, .country-list),
body.dsx-inherited .ff-el-group :is(.iti__dropdown-content, .iti__country-list, .country-list) {
  min-width: 320px !important;
  width: max-content !important;
  max-width: min(520px, calc(100vw - 32px)) !important;
  background: #F7F7F7 !important;
  border: 1px solid rgba(5,5,5,.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 22px 70px rgba(5,5,5,.22) !important;
  overflow: auto !important;
}

body.dsx-inherited .fluentform :is(.iti__country, .country),
body.dsx-inherited .ff-el-group :is(.iti__country, .country) {
  width: 100% !important;
  min-height: 36px !important;
  padding: 9px 12px !important;
  gap: 8px !important;
  color: #050505 !important;
  font-size: 13px !important;
}

/* Data Analytics inherited hero repair. */
body.dsx-inherited.dsx-ai4x-programme .hero-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px !important;
  height: auto !important;
  overflow: visible !important;
}

body.dsx-inherited.dsx-ai4x-programme .hero-chips .chip,
body.dsx-inherited.dsx-ai4x-programme .ds-topbar .lang-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 32px !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  color: rgba(247,247,247,.88) !important;
  box-shadow: none !important;
}

body.dsx-inherited.dsx-ai4x-programme .hero-ctas {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 12px !important;
  height: auto !important;
}

body.dsx-inherited.dsx-ai4x-programme :is(.sc-bars, .sc-kpi-grid, .stage-card.sc-kpi) {
  overflow: visible !important;
}

body.dsx-inherited.dsx-ai4x-programme .sc-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 6px 0 !important;
}

body.dsx-inherited.dsx-ai4x-programme :is(.lbl, .val) {
  display: inline-flex !important;
  color: rgba(247,247,247,.82) !important;
  font-size: 13px !important;
}

body.dsx-inherited.dsx-ai4x-programme .hero-counters {
  width: min(1120px, calc(100% - 48px)) !important;
  margin: 28px auto 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  height: auto !important;
  overflow: visible !important;
  color: rgba(247,247,247,.86) !important;
}

body.dsx-inherited.dsx-ai4x-programme .hero-counters .counter-card {
  width: auto !important;
  height: auto !important;
  min-height: 88px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 18px 20px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.075) !important;
  backdrop-filter: blur(12px) !important;
  color: rgba(247,247,247,.86) !important;
  overflow: hidden !important;
}

body.dsx-inherited.dsx-ai4x-programme .hero-counters .counter-card .num {
  display: block !important;
  font-size: clamp(28px, 3vw, 44px) !important;
  line-height: 1 !important;
  font-weight: 650 !important;
  color: #F7F7F7 !important;
}

body.dsx-inherited.dsx-ai4x-programme .hero-counters .counter-card .lbl,
body.dsx-inherited.dsx-ai4x-programme .hero-counters .counter-card .lang-en,
body.dsx-inherited.dsx-ai4x-programme .hero-counters .counter-card .lang-ar {
  display: block !important;
  width: auto !important;
  color: rgba(247,247,247,.72) !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

/* V9 page-specific repairs from final visual QA. */
body.dsx-inherited .elementor-62665 #hero.genai-section.hero {
  position: relative !important;
  min-height: 820px !important;
  height: auto !important;
  overflow: hidden !important;
  padding: clamp(64px, 8vw, 112px) clamp(20px, 5vw, 72px) !important;
  background:
    radial-gradient(circle at 78% 18%, rgba(105,4,242,.20), transparent 34%),
    linear-gradient(135deg, #180A12 0%, #2B101E 48%, #0B0710 100%) !important;
}

body.dsx-inherited .elementor-62665 .quota-ring-wrap {
  position: absolute !important;
  right: max(-120px, -8vw) !important;
  top: clamp(90px, 12vw, 150px) !important;
  width: min(54vw, 640px) !important;
  height: min(54vw, 640px) !important;
  max-width: 640px !important;
  max-height: 640px !important;
  opacity: .45 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  z-index: 0 !important;
}

body.dsx-inherited .elementor-62665 .quota-ring-wrap svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
}

body.dsx-inherited .elementor-62665 #hero.genai-section.hero > *:not(.quota-ring-wrap),
body.dsx-inherited .elementor-62665 #hero.genai-section.hero :is(.hero-copy,.hero-stack,.metric-card,.tools,.lang-toggle) {
  position: relative !important;
  z-index: 2 !important;
}

body.dsx-inherited .elementor-62665 #hero.genai-section.hero :is(h1,h2,h3,.hero-title,.cine-h1,.elementor-heading-title) {
  color: #F7F7F7 !important;
  text-shadow: 0 14px 42px rgba(0,0,0,.45) !important;
}

body.dsx-inherited .elementor-63190 .hero-stack {
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 72px) !important;
  border-radius: 0 0 36px 36px !important;
  background:
    radial-gradient(circle at 80% 15%, rgba(201,168,110,.18), transparent 30%),
    linear-gradient(135deg, rgba(5,5,5,.82), rgba(20,24,44,.72)) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10) !important;
}

body.dsx-inherited .elementor-63190 .hero-stack :is(h1,h2,h3,.cine-h1,.elementor-heading-title,p,.cine-sub,span) {
  color: #F7F7F7 !important;
  text-shadow: 0 14px 42px rgba(0,0,0,.46) !important;
}

@media (max-width: 767px) {
  body.dsx-inherited .elementor-62665 #hero.genai-section.hero {
    min-height: 780px !important;
    padding: 56px 20px !important;
  }
  body.dsx-inherited .elementor-62665 .quota-ring-wrap {
    width: 380px !important;
    height: 380px !important;
    right: -170px !important;
    top: 120px !important;
    opacity: .38 !important;
  }
}

@media (max-width: 767px) {
  body.dsx-inherited.dsx-ai4x-programme .hero-ctas,
  body.dsx-inherited.dsx-ai4x-programme .hero-chips {
    justify-content: flex-start !important;
  }
  body.dsx-inherited.dsx-ai4x-programme .hero-counters {
    width: calc(100% - 32px) !important;
    grid-template-columns: 1fr !important;
    margin-top: 24px !important;
  }
}
