```python
def canonical_stack_mark(mark: str) -> str:
    if not isinstance(mark, str):
        raise ValueError("Input must be a string")
    
    parts = mark.replace('-', ' ').split()
    if len(parts) != 3:
        raise ValueError("Mark must consist of three parts separated by spaces or hyphens")
    
    floor, wing, stack = parts
    if not (floor.isdigit() and 1 <= int(floor) <= 9):
        raise ValueError("Floor must be a digit from 1 to 9")
    if wing.lower() not in {'n', 's', 'e', 'w'}:
        raise ValueError("Wing must be one of 'n', 's', 'e', 'w'")
    if not stack.isdigit() or len(stack) > 3 or int(stack) == 0:
        raise ValueError("Stack number must be a non-zero digit from 1 to 999, up to three digits")
    
    return f"{floor}{wing.upper()}{stack.zfill(3)}"
```