the CSS will vary depending on how it is added to the sidebar.
If you can share a link to a post where i can see the advert in the sidebar then i can advise.
Thanks for your help. I tried to make the last widget sticky by using the second CSS code you provided, but it doesn’t seem to work. The ad is not sticky.