static bool checkBool(dynamic input, String fieldName) { if (input is bool) return input; throw FormatException("Expected bool for '$fieldName', got ${input.runtimeType}"); }