How to style highlighted code?

I use the default highlighting settings and get code that I do not find visually appealing:

image

I would like to make some changes to the style (notably padding). Is there a way to do this (standard CSS did not work, I guess it is overridden).

/* linenos=true or linenos=table */
.highlight > div  {
  border-radius: 8px;
  padding: 0 1em;
}

/* linenos=false or linenos=inline */
.highlight > pre  {
  border-radius: 8px;
  padding: 1em;
}