Loss from Self-Employment

I am 67 years old and have worked as an attorney/sole practitioner for over 25 years. I am still active as a licensed attorney and have pending cases and clients. In 2021 I had a medical issue and decided to reduce my work load. That year I had $43k of self-employment net income. In 2022 I started taking social security, had net self-employment income as an attorney of $11k. In 2023 I had gross revenue of $7k but $15k of expenses and took a loss of $8k as an attorney. In 2024 my operating loss as an attorney was $18k.  I continue to practice law and have office space and clients. With my spouse each year we have had joint net  taxable income over $100k. Can I continue to take a loss in 2025 if expenses exceed revenue? Or will the IRS refuse to accept my operating loss as an attorney?