Safely evaluate an arithmetic expression (+ - * / % ^ and parentheses). No code execution — a real parser, not eval.