Here is a partial answer for the easier scenario from initial weighing. I've solved the other scenario in the past (caveat: can't remember if I was able to determine heavier or lighter) but I never remember it and it takes me a while to get it again.
Weigh 4 vs. 4
- if the two sides are the same, go to A
- if one side is heavier, go to B
A) The counterfeit is in the unweighed group of 4. The other 8 are guaranteed real. Weigh 3 of the potential counterfeits vs. 3 real.
- if the two sides are the same, go to AA
- if one side is heavier, go to AB
AA) The counterfeit is the one potential that you did not weigh. Weigh it vs. 1 real to determine whether it is heavier or lighter.
AB) The counterfeit is in the group of 3 you just weighed and you know whether it is heavier or lighter. Weigh 1 of them vs. another 1 of them.
- if the two sides are the same, the counterfeit is the one you did not weigh.
- if one side is heavier, you know which of the 2 is the counterfeit.
B) The counterfeit is among the 8 you weighed. The other 4 are guaranteed real.
What now?