diff --git a/app/Controllers/Opd.php b/app/Controllers/Opd.php
index 57859eb..9d4ec37 100644
--- a/app/Controllers/Opd.php
+++ b/app/Controllers/Opd.php
@@ -3593,8 +3593,8 @@ class Opd extends BaseController
if ($lineBreakAfterLabel) {
// List-style sections (Complaint, Diagnosis …):
// heading on its own line, content block below with a small left indent.
- // margin-bottom:12px gives clear visual separation between consecutive sections.
- return '
'
+ // margin-bottom:18px gives clear visual separation between consecutive sections.
+ return '
'
. $headingHtml
. '
'
. $value
@@ -3602,8 +3602,8 @@ class Opd extends BaseController
}
// Inline sections (Vitals, Investigation, Next Visit):
- // heading + value on the same line; same 12px gap after block.
- return '
'
+ // heading + value on the same line; same 18px gap after block.
+ return '
'
. $headingHtml
. '
'
. $value
@@ -3840,9 +3840,13 @@ class Opd extends BaseController
$medicalHtml = trim((string) ($tokens['medical'] ?? ''));
$tokens['Rx'] = $medicalHtml !== ''
- ? ''
+ ? ''
: '';
$tokens['rx'] = $tokens['Rx'];
+ // {{medical}} used directly in templates: wrap with the same top/bottom margin.
+ $tokens['medical'] = $medicalHtml !== ''
+ ? '' . $medicalHtml . '
'
+ : '';
$tokens['VitalsBlock'] = (string) ($tokens['vital_content'] ?? '');
$tokens['ComplaintBlock'] = (string) ($tokens['Complaint'] ?? '');