I wonder if `box-sizing: border-box` would simplify this?