With @layer this has become simpler:
/* define layer order. Not necessary here */
@layer pico, nils;
/* import framework into layer */
@import url("pico.css") layer(pico);
/* define own styles in own layer, they have precedence. CSS vars are still global. */
@layer nils {
p:first-of-type {
color: green;
}
}