The gray area comes not from the terrorists but by the way US conducts its wars. It fought the Afganistan and Iraq armies and defeated them, at that point there is no longer the excuse of 'these terrorists are confusing us and endangering civilians'. At this point US is an occupier of a foreign country and as such is responsible for the population's safety. If it chooses to not afford lawful process it is on US, but at this point terror attacks and insurgency are not a war they are criminal acts from the population against the ruling government.
Just like 9/11 is not some sovereign country invading US. It's a lot more like Tim McVeigh bombing Oklahoma City than Perl Harbor.
I think this whole 'war on terror' language is just pulling the wool over people to confuse things.