Mr. Karim’s flyer and Mrs. Yanti’s stamp overlap on the market board: write their declarations, elementFromPoint answers who is on top, and every stacking…
"z-index is already 9999 but the modal/tooltip is still covered" is one of the most frustrating CSS bugs. Once you understand stacking contexts, you know to look for the parent that starts a context, not to keep raising the number.
z-index is only compared inside one stacking context
z-index again and again, the popup is still covered The number is not the problem: an ancestor has opacity, transform, filter or will-change. Walk up the parents and remove the context maker, or raise that ancestor itself.opacity: 0.99 added "to fix rendering" quietly breaks other layers Any opacity below 1 starts a new context. So do transform and will-change, often added for performance.body (or use <dialog>, which goes into the top layer) to escape the parent’s context.opacity: 0.99 on .card-a The 9999 flyer sinks under Mrs. Yanti’s paper. In the tree, the flyer moves inside .card-a’s context.transform, filter, will-change. Same result: a new context.position: relative; z-index: 2 to .card-a. Its whole context rises.isolation: isolate A context maker with no visual effect at all. The cleanest for components.