If you apply sticky to the parent container it will work… though, if there are other alerts in this container they’ll stick too (like the “Do you want live notifications when people reply to your posts?” alert).
We have a CSS property that will properly offset the top from the header:
#main-container.container {
position: sticky;
top: var(--header-offset);
z-index: 9;
}