```python
def tag_trim(tag: str) -> str:
    """Strip leading hash and trailing colon from a tag."""
    if tag.startswith("#") and tag.endswith(":"):
        return tag[1:-1]
    return tag
```