I was once a junior doctor and just ran your question through openevidence, an AI designed specifically for doctors (much more reliable than Chat GPT, because the AI is trained on the American research guidelines.)
To summarise, it says you're ok. But agree you might as well wear gloves in the future, but no need to panic at all.
Here's what it said (I literally copied and pasted your original message into it when asking the question):
Incidental dermal exposure to ibuprofen gel, especially with brief contact and thorough hand washing, results in minimal systemic absorption and is unlikely to pose significant risk to the fetus, particularly compared to oral NSAID use.[1][2] Topical NSAIDs, including ibuprofen gel, are generally avoided late in pregnancy due to theoretical risks of fetal renal dysfunction and premature ductus arteriosus closure, but case reports of complications are rare and typically involve prolonged or extensive exposure.[1][2] The American Academy of Family Physicians recommends limiting NSAID use in pregnancy, especially after 20 weeks, but does not specifically address brief incidental contact; expert opinion suggests that such exposure is not expected to cause harm and no additional monitoring is required unless symptoms develop.[1] There is a lack of direct studies on brief, incidental dermal exposure in pregnancy, so while available evidence is reassuring, definitive data are limited and further research may be needed. [1][2]
In summary, brief incidental exposure to ibuprofen gel via hand contact, followed by thorough washing, is not expected to cause fetal harm. No additional action is required unless symptoms develop. The consensus of current clinical guidelines and literature is that significant fetal risk is associated with systemic NSAID exposure, particularly oral or prolonged topical use, rather than brief dermal contact.[1][2]