def flatten(obj, path=""):
    """Flatten nested dicts into hierarchical keys."""
    result = {}
    if isinstance(obj, dict):
        for key, item in obj.items():
            result.update(flatten(item, path=(path + "." if path else "") + key.lower()))
    elif isinstance(obj, (str, int, float, bool)):
        result[path] = obj
    return result