Before at least for the % of that is SS taxed....AND
For the SS tax, It also includes tax-exempt $$ in line 2a of your form 1040 as a part of the income included in the calculation.
_____
Haven't thought about the "additonal" Medicare tax for high income individuals...but you might need to have a pretty high income for that.
If you are referring to the self-employment tax which is Social Security and Medicare tax that you pay on Schedule C or self-employment income, it is calculated separately without regard to the standard deduction.
The self-employment income reported on Schedule C is included with your other income prior to subtracting the standard deduction. Then your income tax is calculated. After that, the income tax may be reduced by certain credits claimed on your return. Next, the self-employment tax is added to any remaining income tax (plus any other taxes imposed on your return that are less common). At that point, your income tax withholdings and estimated payments are applied to the total tax to determine whether you will receive a refund or have a balance due.