Based on this I managed to fix the margin/border:
The files can be opened from Joplin: Tools->Options->General->Appearance->Show Advanced
Custom stylesheet for rendered Markdown (userstyle.css):
.joplin-container-content {
padding-left: 0 !important;
padding-right: 0 !important;
}
Custom stylesheet for Joplin-wide app styles (userchrome.css):
.rli-editor > div > div > div > div:nth-child(2) > div > div:nth-child(2) {
flex-direction: row-reverse !important;
& > div:first-child {
border-left: 1px solid rgb(85, 85, 85) !important;
.CodeMirror-scroll {
padding-left: 10px;
}
}
& > div:nth-child(2) {
border: none !important;
}
}
After applying these, Joplin must be completely restarted with Ctrl+Q or File->Quit (not just closed).
I'm using the Dark theme; the border color might be different for other themes.