I'm trying to create blocks and elements with rounded corners and a gap between the corner and the straight line. Turns out its a little bit difficult :)

I also have to create "button" like this,

and

If I can not create them in pure CSS I will use svg for this, but I have to solve the above problem first.
Anyone have some idea?