import typing
import decimal


def parse_amount_input(amount_str: str) -> typing.Optional[decimal.Decimal]:
    """Parse an amount in a human-forgiving way."""
    try:
        return decimal.Decimal(amount_str)
    except decimal.InvalidOperation:
        try:
            return decimal.Decimal(amount_str.replace(",", "."))
        except ValueError:
            return None