:root{--sd-on-dark:#fff;--sd-on-dark-muted:#e7eff8;--sd-on-light:#071526}

/* Superficies oscuras estandarizadas. */
:where(.on-dark,.surface-dark,[data-surface="dark"]),
:where(.on-dark,.surface-dark,[data-surface="dark"]) :where(h1,h2,h3,h4,p,li,a,span,strong,b,small,label,legend,summary){
  color:var(--sd-on-dark)!important;
  -webkit-text-fill-color:var(--sd-on-dark)!important;
}

/* Encabezados y etiquetas colocados directamente sobre secciones oscuras. */
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark) .eyebrow,
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark) .dark-label,
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark)>.wrap>:where(h1,h2,h3,p){
  color:var(--sd-on-dark)!important;
  -webkit-text-fill-color:var(--sd-on-dark)!important;
}

:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark)>.wrap>p:not(.eyebrow){
  color:var(--sd-on-dark-muted)!important;
  -webkit-text-fill-color:var(--sd-on-dark-muted)!important;
}

/* Cabecera, pie y llamadas comerciales. */
.top,.top a,footer,footer a,.cta,.cta:visited{
  color:var(--sd-on-dark)!important;
  -webkit-text-fill-color:var(--sd-on-dark)!important;
}

/* Las tarjetas claras recuperan siempre texto oscuro. */
:where(.hero-card:not([data-surface="dark"]),.light-card,.card-light,[data-surface="light"]),
:where(.hero-card:not([data-surface="dark"]),.light-card,.card-light,[data-surface="light"]) :where(h1,h2,h3,h4,p,li,a,span,strong,b,small,label,legend,summary){
  color:var(--sd-on-light)!important;
  -webkit-text-fill-color:var(--sd-on-light)!important;
}

/* Safari/iOS: impide que un text-fill oscuro heredado sobreviva sobre azul,
   negro, morado o cualquier superficie declarada como oscura. */
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark,[data-surface="dark"])
  :where(h1,h2,h3,h4,h5,h6,p,li,a,span,strong,b,em,small,dt,dd,label,legend,summary,button){
  color:var(--sd-on-dark)!important;
  -webkit-text-fill-color:var(--sd-on-dark)!important;
  opacity:1!important;
}
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark,[data-surface="dark"])
  :where(.muted,[class*="muted"],.secondary){
  color:var(--sd-on-dark-muted)!important;
  -webkit-text-fill-color:var(--sd-on-dark-muted)!important;
}
/* Las superficies claras anidadas conservan texto oscuro. */
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark,[data-surface="dark"])
  :where(.surface-light,[data-surface="light"],.sd-card,.notice,.warning,.multi-flow span),
:where(.hero,.section.dark,.dark-section,.section-dark,.purple,.navy,.bg-dark,[data-surface="dark"])
  :where(.surface-light,[data-surface="light"],.sd-card,.notice,.warning,.multi-flow span) *{
  color:var(--sd-on-light)!important;
  -webkit-text-fill-color:var(--sd-on-light)!important;
}

