```python
def region_totals(grid: list, queries: list) -> list:
    if not isinstance(grid, list) or not grid:
        raise ValueError("grid must be a non-empty list of rows")
    width = len(grid[0]) if isinstance(grid[0], list) else 0
    if width == 0:
        raise ValueError("rows must be non-empty lists")
    for row in grid:
        if not isinstance(row, list) or len(row) != width:
            raise ValueError("rows must all share one length")
        for cell in row:
            if isinstance(cell, bool) or not isinstance(cell, int):
                raise ValueError("cells must be integers")
    
    grid_height = len(grid)
    prefix_sum_table = [[0] * (width + 1) for _ in range(grid_height + 1)]
    
    for i in range(1, grid_height + 1):
        for j in range(1, width + 1):
            prefix_sum_table[i][j] = (
                grid[i - 1][j - 1]
                + prefix_sum_table[i - 1][j]
                + prefix_sum_table[i][j - 1]
                - prefix_sum_table[i - 1][j - 1]
            )
    
    results = []
    for query in queries:
        if not isinstance(query, list) or len(query) != 4:
            raise ValueError("each query must be a list of exactly four integers")
        top, left, bottom, right = query
        if (top < 0 or bottom > grid_height or left < 0 or right > width or
                top >= bottom or left >= right):
            raise ValueError("invalid query range")
        
        total = (
            prefix_sum_table[bottom][right]
            - prefix_sum_table[top][right]
            - prefix_sum_table[bottom][left]
            + prefix_sum_table[top][left]
        )
        results.append(total)
    
    return results
```