When selling an equity, one has to pay the estimated taxes on any capital gain realized from that sale by filing a 1040ES tax estimate with the IRS for the appropriate quarter during which the gain was earned. I understand the reason for that, as taxes on earnings are due when they are earned during the year. My questions pertaining to estimated taxes are these:

First, in the case of the first, second and third quarters, the forms for the quarterly tax estimates have due dates that fall before the actual end of the last day of those quarters. Taxes due for the quarter ending June 30, for example, are due somewhere around June 15. I didn't decide to sell one of my equities until June 30. Taxes on that gain were already LATE on the day the gain was realized. Is there a penalty due if I submit the form and pay the tax on that capital gain along with any gain for the quarter ending September 30?

Second, If I sell more than one equity, one having a capital gain and one with an offsetting capital loss which, resulting in an overall slight loss, are the estimated taxes on the gain portion still due for the quarter in which the gain was realized? My initial thought was to assume not, seeing that there was no actual overall gain. However, as screwed up as the IRS is, my second thought was they just might require me to pay it so they can give it back to me next April.