Sexual harassment is wrong, regardless of who is the victim and who is the perpetrator and regardless of whether both are of the same sex or the opposite sex.

The Supreme Court wisely and unanimously ruled Wednesday that a federal law banning on-the-job sexual harassment can apply even when the harasser and victim are the same sex.The high court overturned a federal appeals court ruling that Title VII of the Civil Rights Act of 1964 doesn't apply to same-sex harassment. By doing so, it sent an important message that standards of decent behavior need to be upheld regardless of the sex of those involved.

The court also made clear that someone claiming same-sex harassment must prove that the conduct is discrimination based on gender, not on actions "merely tinged with offensive sexual connotations" such as flirting or horseplay. The conduct would have to be hostile or abusive, the court said.

The ruling was the result of a lawsuit filed by a roustabout assigned to a Gulf of Mexico oil rig with Sundowner Offshore Services. He sued Sundowner and three men, claiming he was sexually assaulted, battered and threatened with rape by two of the three, with the other man taking part in another alleged incident. The man who sued said he twice reported the situation but no action was taken. As a result he said he quit out of fear the incidents would escalate.

Regarding what does and doesn't constitute sexual harassment, Justice Antonin Scalia, who wrote the court's opinion, said: "Common sense, and an appropriate sensitivity to social context, will enable courts and juries to distinguish between simple teasing or roughhousing among members of the same sex, and conduct which a reasonable person in the plaintiff's position would find severely hostile or abusive."

Staying away from conduct that might be construed as inappropriate is the best way to avoid trouble.