Provided:
- I'm a disaster with CSS
- what I'm suggesting may or may not work
- there may be an easier way to achieve the same
You may try changing:
<div id="sp_center_top" class="sp_main_cell">
to:
<div id="sp_center_top" class="sp_main_cell" '
, !empty($modSettings['rightwidth']) || !empty($modSettings['leftwidth']) ? ' style="width: calc(100% - ' . (!empty($modSettings['rightwidth']) ? $modSettings['rightwidth'] . 'px - 20px' : '0') . ' - ' .
(!empty($modSettings['leftwidth']) ? $modSettings['leftwidth'] . 'px - 20px' : '0') . ')"', '>
in Portal.template.php.
It MAY work.