Can you be my medicine Professor and teach me how to Approach to Jaundice systematically in a medical ward. Teach me the insight of clinical pearls with pathophysiological reasoning for each concept.

Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Loading Image
Reading File
Finding Sources
Finding Sources
Reading File
Loading Image
Reading File
Finding Sources
I now have all the comprehensive content needed from the authoritative textbooks. Let me now compose the full lecture.
I have gathered rich data from:
  • Harrison's Principles of Internal Medicine 22E (2025) - the full diagnostic framework, history, exam, LFT interpretation
  • Lippincott Illustrated Reviews: Biochemistry 8th Ed - bilirubin metabolism pathway with diagrams
  • Schwartz's Principles of Surgery 11th Ed - prehepatic/hepatic/posthepatic classification
  • Goldman-Cecil Medicine - cirrhosis and decompensation context

🩺 Professor's Ward Round Lecture: Systematic Approach to Jaundice


Opening Concept: What IS Jaundice?

Jaundice (icterus) is the yellow discoloration of skin, sclerae, and mucous membranes from bilirubin deposition in tissues. It becomes clinically visible when serum bilirubin rises above 2-3 mg/dL (normal ≀1 mg/dL).
Clinical Pearl #1 - Sclerae First: The sclerae appear yellow before the skin because elastin in the sclera has a high affinity for bilirubin. Always examine the sclerae in natural light - artificial light can mask it. Scleral icterus is detectable at ~2-3 mg/dL, before skin changes appear.
Clinical Pearl #2 - Pseudojaundice: Yellow skin without scleral icterus = carotenemia (excess beta-carotene from carrot/pumpkin intake). Bilirubin does NOT have affinity for the avascular lens - so the sclerae are spared. This simple bedside rule saves unnecessary workup.

Step 1: The Pathophysiological Foundation - Bilirubin Metabolism

Before you can reason about jaundice, you must own the bilirubin pathway:
Bilirubin metabolism - hemolytic vs neonatal jaundice
Lippincott Illustrated Reviews: Biochemistry, 8th Ed - Fig 21.12
The journey of bilirubin (5 key steps):
StepLocationWhat HappensPathology if Disrupted
1. ProductionRES (spleen, liver, bone marrow)Heme β†’ biliverdin β†’ unconjugated bilirubin (UCB)Hemolysis, ineffective erythropoiesis
2. TransportBloodUCB bound to albumin (lipid-soluble, cannot be filtered by kidney)Hypoalbuminemia β†’ more free UCB β†’ kernicterus risk
3. UptakeHepatocyteUCB taken up via OATP1B1/1B3 transportersRifampicin, probenecid block this
4. ConjugationHepatocyte ERUCB + glucuronic acid β†’ conjugated bilirubin (CB) via UDP-glucuronosyltransferase (UGT1A1)Gilbert's (↓ UGT), Crigler-Najjar I/II
5. ExcretionBile canaliculiCB excreted via MRP2 (ABCC2) transporter into bileDubin-Johnson (MRP2 mutation), cholestasis
In the gut: CB β†’ urobilinogen (by bacteria) β†’ some reabsorbed (enterohepatic circulation) β†’ urobilin (urine) + stercobilin (stool, brown color).
Clinical Pearl #3 - The "liver has enormous reserve": The liver can conjugate and excrete >3,000 mg bilirubin/day. Normal daily production is only ~300 mg/day. This 10:1 excess capacity is why hemolytic jaundice rarely pushes bilirubin above 5 mg/dL - the liver easily compensates up to a point. If a hemolytic patient has bilirubin >5 mg/dL, suspect concomitant liver disease or choledocholithiasis (pigment stones - common in chronic hemolysis!).

Step 2: The Master Framework - Three Zones of Dysfunction

Hyperbilirubinemia results from three fundamental mechanisms (Harrison's, 22E):
  1. Overproduction of bilirubin
  2. Impaired uptake, conjugation, or excretion of bilirubin
  3. Regurgitation of UCB or CB from damaged hepatocytes or bile ducts
This maps to the classic Prehepatic / Hepatic / Posthepatic triad:

Zone 1: PREHEPATIC (Pre-hepatic = Hemolytic)

Pathophysiology: Excessive heme breakdown overwhelms the liver's conjugation capacity β†’ UCB accumulates in blood.
Key Feature: UCB is bound to albumin β†’ cannot cross glomerular filtration β†’ urine is NOT dark (no bilirubinuria). This is one of the most reliable bedside distinguishing features.
Causes:
  • Inherited: Spherocytosis, sickle cell anemia, thalassemia, G6PD deficiency, pyruvate kinase deficiency
  • Acquired: Microangiopathic hemolytic anemia (HUS/TTP), PNH, autoimmune hemolysis (positive Coombs), malaria, babesiosis
  • Ineffective erythropoiesis: B12/folate/iron deficiency
  • Others: Massive blood transfusion, resorption of large hematoma
Labs pattern:
  • ↑ Total bilirubin with indirect (UCB) fraction dominant (direct fraction < 15% of total)
  • LFTs (ALT, AST, ALP) - NORMAL
  • ↑ Reticulocyte count, ↓ Hb, ↑ LDH, ↓ haptoglobin
  • Urine: urobilinogen ↑↑, NO bilirubin
  • Stool: dark brown (excess stercobilin)
Clinical Pearl #4: Bilirubin rarely exceeds 5 mg/dL in pure hemolysis. The liver compensates magnificently. If you see bilirubin of 8-10 mg/dL in a patient with sickle cell anemia, think: (a) acute sickle cell crisis, (b) concomitant pigment gallstones causing CBD obstruction, or (c) underlying hepatocellular dysfunction. Pigment gallstones are found in up to 30% of sickle cell patients.

Zone 2: HEPATIC (Intrahepatic)

This zone is the most complex - it can produce either UCB or CB dominance depending on which step within the hepatocyte is disrupted.

2A. Hepatic - Isolated (No other LFT abnormality)

These are genetic/benign disorders:
Unconjugated (UCB) - conjugation defects:
ConditionDefectBilirubin LevelNotes
Gilbert's syndrome↓ UGT1A1 activity (~30% of normal)<6 mg/dL, usually <3 mg/dL4-7% of population; triggered by fasting, illness, stress, alcohol
Crigler-Najjar Type IComplete UGT1A1 absence>20 mg/dLFatal without liver transplant; kernicterus inevitable
Crigler-Najjar Type IIPartial UGT1A1 deficiency6-20 mg/dLResponds to phenobarbitone (induces residual UGT activity)
Conjugated (CB) - excretion defects:
ConditionDefectFeature
Dubin-JohnsonMRP2 (ABCC2) mutation - can't excrete CB into bileBlack liver pigment on biopsy; coproporphyrin I in urine ↑↑
Rotor syndromeOATP1B1/1B3 deficiency - impaired hepatic CB reuptakeNormal liver biopsy; coproporphyrin III in urine ↑↑
Clinical Pearl #5 - Gilbert's Syndrome: This is incredibly common and a frequent source of unnecessary investigations. The classic trigger is 48-hour fasting (bilirubin rises ~2-fold) or intercurrent illness. Key diagnostic clue: young patient, mildly icteric, no other abnormal LFTs, no hemolysis. The fasting test (24-48h fast β†’ bilirubin doubles) confirms it. Reassure the patient - it carries no mortality and may be cardioprotective (UCB is an antioxidant).

2B. Hepatic - With other LFT abnormalities (Hepatocellular disease)

Pathophysiology: Hepatocyte injury β†’ dual dysfunction: both conjugation fails AND damaged membranes allow CB to leak back into sinusoids β†’ mixed hyperbilirubinemia (CB + UCB elevated, but CB dominates).
Causes (hepatocellular pattern):
  • Viral hepatitis (A, B, C, D, E), EBV, CMV, HSV
  • Alcoholic hepatitis
  • Drug/toxin-induced liver injury (DILI) - APAP overdose (dose-dependent), chlorpromazine, INH
  • Autoimmune hepatitis (young-middle aged women, ANA/SMA positive)
  • Wilson's disease (patient <55 years, ceruloplasmin ↓, KF rings)
  • End-stage cirrhosis
  • Ischemic hepatitis ("shock liver") - transaminases can go >10,000 U/L
LFT pattern - Hepatocellular:
  • ↑↑ ALT and AST (disproportionately elevated compared to ALP)
  • AST:ALT ratio >2:1 suggests alcoholic hepatitis (because alcohol causes mitochondrial damage β†’ AST release, and pyridoxine deficiency β†’ less ALT synthesis)
  • ALP mildly elevated or normal
  • ↑ PT/INR (hepatocellular synthetic failure)
  • ↓ Albumin in chronic disease
Clinical Pearl #6 - The AST:ALT Ratio (De Ritis Ratio):
  • >2:1 (especially >3:1): Alcoholic hepatitis (sensitivity ~70%, specificity ~80%)
  • >10:1 with very high transaminases (>3000 U/L): Think ischemic hepatitis or APAP toxicity first - NOT viral hepatitis
  • ALT > AST in most viral hepatitis (liver-specific enzyme, longer half-life)
  • In Wilson's disease presenting as acute liver failure: ALP is paradoxically low - a critical red flag. The mechanism is copper inhibiting alkaline phosphatase.

2C. Hepatic - Intrahepatic Cholestasis

Pathophysiology: Bile flow is impaired at the level of the hepatocyte or small intrahepatic bile ducts, despite no mechanical extrahepatic block β†’ CB accumulates.
Causes:
  • Primary biliary cholangitis (PBC) - AMA positive, middle-aged women
  • Primary sclerosing cholangitis (PSC) - associated with IBD (UC > CD)
  • Drug-induced: anabolic steroids, OCP, chlorpromazine, erythromycin estolate
  • Pregnancy cholestasis (intense pruritus in 3rd trimester)
  • Sepsis-associated cholestasis (endotoxins impair bile secretion)
  • Infiltrative disease: TB, lymphoma, amyloidosis, sarcoidosis
  • Malaria, leptospirosis
LFT pattern - Cholestatic:
  • ALP elevated out of proportion to aminotransferases
  • GGT elevated (confirms hepatic source of ALP - not bone)
  • Bilirubin (CB) elevated
  • Pruritus from bile salt accumulation in skin
Clinical Pearl #7 - ALP and GGT as a Pair: ALP alone is non-specific - it rises in bone disease, pregnancy (placenta), growing children, and healing fractures. Always confirm hepatic source with GGT. GGT + ALP both elevated = hepatobiliary. GGT normal + ALP elevated = bone. GGT is also elevated by alcohol and enzyme-inducing drugs (phenytoin, rifampicin) even without structural damage.

Zone 3: POSTHEPATIC (Extrahepatic Cholestasis)

Pathophysiology: Mechanical obstruction of the common bile duct or more proximal biliary tree β†’ bile cannot drain β†’ CB backs up into hepatocytes β†’ regurgitates into sinusoids β†’ enters systemic circulation. Because bile cannot reach the gut: no CB β†’ no urobilinogen β†’ no stercobilin β†’ pale stools + dark urine.
Causes:
  • Benign: Choledocholithiasis (CBD stones), benign biliary strictures, chronic pancreatitis, Mirizzi's syndrome, primary sclerosing cholangitis, ascariasis
  • Malignant: Pancreatic head carcinoma, cholangiocarcinoma (Klatskin tumor at hilum), ampullary carcinoma, gallbladder carcinoma, porta hepatis lymph nodes (from lymphoma/metastases)
LFT pattern - Obstructive:
  • ↑↑ ALP (3-4x normal)
  • ↑ GGT
  • ↑ CB (direct bilirubin dominates)
  • ALT/AST mildly elevated
  • Dark urine (bilirubinuria - CB is water-soluble, gets filtered by kidney)
  • Pale/clay-colored stools
Clinical Pearl #8 - Courvoisier's Law:
"If the gallbladder is palpable and the patient is jaundiced, the obstruction is unlikely to be due to a stone."
The reason: chronic choledocholithiasis causes repeated inflammation β†’ fibrosis β†’ shrunken, thickened gallbladder wall that cannot dilate. Malignant obstruction (pancreatic cancer, cholangiocarcinoma) is gradual with no prior inflammation β†’ the gallbladder dilates slowly β†’ becomes palpable.
However: 50% of pancreatic cancers with CBD obstruction do NOT have a palpable gallbladder (false negative), and cholangiocarcinoma obstructs above the cystic duct insertion, so the gallbladder is not behind the obstruction. Courvoisier's is a useful pointer, not a rule.
Clinical Pearl #9 - Pain Character in Obstructive Jaundice:
  • Colicky RUQ pain β†’ jaundice (intermittent): CBD stone - stone migrates, transiently obstructs
  • Constant severe RUQ pain + fever + jaundice = Charcot's triad β†’ Ascending cholangitis (emergency!)
  • Charcot's triad + hypotension + altered consciousness = Reynolds' pentad β†’ Life-threatening septic cholangitis, needs urgent ERCP + antibiotics
  • Painless progressive jaundice + weight loss: Pancreatic head or ampullary carcinoma until proven otherwise

Step 3: The Diagnostic Algorithm (Harrison's Framework)

Evaluation of the patient with jaundice - Harrison's Diagnostic Algorithm
Harrison's Principles of Internal Medicine, 22nd Ed (2025) - Figure 52-1
Phase 1 - The two-branch decision tree:
First ask: "Is the bilirubin elevated in isolation, or are there other LFT abnormalities?"
  • Isolated bilirubin elevation:
    • Direct (CB) > 15% of total β†’ Dubin-Johnson or Rotor syndrome
    • Indirect (UCB) dominant β†’ Hemolysis, Gilbert's, Crigler-Najjar, drugs
  • Bilirubin + other LFTs abnormal:
    • Hepatocellular pattern (↑↑ ALT/AST > ALP): Hepatitis, DILI, cirrhosis
    • Cholestatic pattern (↑↑ ALP > ALT/AST): Intrahepatic or extrahepatic cholestasis β†’ ultrasound next
      • Dilated ducts β†’ Extrahepatic β†’ CT/MRCP/ERCP
      • Non-dilated ducts β†’ Intrahepatic β†’ serologies (AMA, ANA, hepatitis)

Step 4: Targeted History - The Single Most Important Tool

From Harrison's 22E: "A complete medical history is perhaps the single most important part of the evaluation of the patient with unexplained jaundice."
Systematic history checklist:
DomainWhat to AskWhy It Matters
Drugs & toxinsAll medications incl. OTC, herbal supplements, anabolic steroidsDrug-induced liver injury (DILI) is diagnosis of exclusion
AlcoholUnits/week, duration, last drinkAlcoholic hepatitis: >3 drinks/day in men, >2 in women
Parenteral exposuresIV drug use, tattooing, blood transfusions, piercingsHepatitis B and C transmission
Sexual historyNew partners, MSMHepatitis B, A
TravelRecent travel, endemic areasHepatitis A, E (fecal-oral), malaria, leptospirosis
Food historyRaw shellfish, contaminated waterHepatitis A, E
Pain characterColicky vs constant, locationStone vs. inflammation vs. malignancy
Associated symptomsFever, chills (cholangitis), pruritus (cholestasis), weight loss (malignancy), arthralgias (viral prodrome)Points to etiology
DurationAcute vs. subacute vs. chronicAcute: viral/toxic; chronic: cirrhosis/malignancy
Urine/stool colorDark urine = conjugated bilirubinemia; pale stools = obstructiveDistinguishes pre-hepatic from post-hepatic
Family historyHemolytic anemias, liver diseaseGilbert's, spherocytosis are familial
OccupationHealthcare worker, sewage workerHepatitis B/C; leptospirosis
PregnancyTrimesterAFLP (3rd trimester emergency), intrahepatic cholestasis

Step 5: Systematic Physical Examination

Inspect (general):
  • Nutritional status - temporal wasting β†’ chronic disease (cirrhosis, malignancy)
  • Pallor β†’ hemolysis
  • Depth of jaundice: mild (lemon yellow) β†’ hemolytic/Gilbert's; deep yellow-green β†’ prolonged cholestasis
Stigmata of chronic liver disease (CLD):
SignSignificance
Spider nevi (>5, in SVC territory)Estrogen excess from impaired hepatic metabolism
Palmar erythemaSame mechanism as spider nevi
Gynecomastia, testicular atrophyEstrogen-androgen imbalance
Caput medusaePortal hypertension β†’ recanalization of umbilical vein
Dupuytren's contractureAlcoholic liver disease
Parotid enlargementAlcohol
Leukonychia / Terry's nailsHypoalbuminemia
ClubbingHepatopulmonary syndrome, cirrhosis
Flapping tremor (asterixis)Hepatic encephalopathy
Abdominal examination:
FindingSignificance
Hepatomegaly (smooth, tender)Viral hepatitis, congestive hepatopathy, early cirrhosis
Hepatomegaly (hard, nodular)Malignancy, late cirrhosis
Enlarged left lobe felt at xiphoidCirrhosis (right lobe shrinks, left lobe hypertrophies)
SplenomegalyPortal hypertension, hemolysis, hematological malignancy
Murphy's sign positiveAcute cholecystitis
Palpable gallbladder (non-tender)Courvoisier's sign - malignant obstruction
AscitesCirrhosis or malignancy (peritoneal spread)
Lymph nodes:
  • Virchow's node (left supraclavicular) β†’ abdominal/GI malignancy (Troisier's sign)
  • Sister Mary Joseph's nodule (periumbilical) β†’ peritoneal metastasis

Step 6: Laboratory Investigation Strategy

First-Line Panel (Everyone)

  1. Total bilirubin + fractionation (direct/indirect)
  2. ALT, AST, ALP, GGT - pattern recognition
  3. Albumin - synthetic function, chronicity marker
  4. PT/INR - synthetic function, severity marker
  5. FBC - anemia, reticulocytes, thrombocytopenia (hypersplenism)
  6. Peripheral blood smear - spherocytes, schistocytes, sickle cells, malarial parasites
  7. Urine: bilirubin + urobilinogen - bedside urine dipstick

Urine Dipstick - The Most Underused Bedside Test:

FindingBilirubin in urineUrobilinogenInterpretation
Pre-hepaticAbsent (UCB can't be filtered)↑↑Hemolysis
HepaticPresent ↑Variable (↑ early, ↓ late in liver failure)Hepatocellular
Post-hepaticPresent ↑↑Absent (no bile reaching gut)Obstruction
Clinical Pearl #10: In complete bile duct obstruction, urobilinogen is absent from both urine and stool. The urine is dark from conjugated bilirubin, but the dipstick urobilinogen will be zero. This is a powerful clue for complete obstruction vs. incomplete or hepatic disease.

Second-Line (Based on Pattern):

Hepatocellular workup:
  • Hepatitis serologies: HBsAg, anti-HBc IgM, HCV RNA, anti-HAV IgM, anti-HEV IgM
  • Ceruloplasmin + 24h urine copper (if patient <55 years β†’ Wilson's disease)
  • ANA, ASMA, anti-LKM1, SPEP β†’ Autoimmune hepatitis
  • APAP level, toxicology screen
  • CMV DNA, EBV VCA IgM (especially in young patients with atypical lymphocytosis)
Cholestatic/obstructive workup:
  • Ultrasound abdomen - first-line imaging; can detect CBD dilatation (>6 mm), gallstones, liver masses, pancreatic head
  • CT abdomen - if US inconclusive; better for pancreatic head, hilar mass
  • MRCP - non-invasive biliary tree mapping (gold standard for CBD anatomy)
  • ERCP - therapeutic + diagnostic; for stones (extraction), strictures (stenting), tissue biopsy
  • AMA (anti-mitochondrial antibody) β†’ Primary biliary cholangitis (>90% sensitive)
  • ANCA, anti-smooth muscle β†’ PSC

Severity Assessment:

  • Child-Pugh score (albumin, bilirubin, INR/PT, ascites, encephalopathy) - prognosis in cirrhosis
  • MELD score (bilirubin, creatinine, INR) - liver transplant listing
  • Maddrey's Discriminant Function (4.6 Γ— [PT - control] + serum bilirubin in mg/dL) - if >32 in alcoholic hepatitis β†’ corticosteroids may be indicated

Step 7: Key Clinical Syndromes - High-Yield Differentials

Acute Jaundice with Fever:

  • + RUQ pain + rigors = Ascending cholangitis (Charcot's triad) - ERCP emergency
  • + RUQ pain + signs of shock = Reynolds' pentad - ICU + urgent ERCP
  • + Prodromal viral illness = Viral hepatitis (A, E most common acute jaundice globally)
  • + Travel to endemic area + splenomegaly = Malaria - urgent blood film
  • + Conjunctival suffusion + muscle tenderness + epidemiological risk = Leptospirosis (Weil's disease) - severe form causes AKI + jaundice

Chronic/Gradual Jaundice:

  • + Portal hypertension signs + alcohol history = Alcoholic cirrhosis
  • + Middle-aged woman + intense pruritus + AMA+ = Primary biliary cholangitis
  • + Young man + IBD + PSC features = Primary sclerosing cholangitis
  • + Kayser-Fleischer rings + neuropsychiatric features + age <55 = Wilson's disease
  • + Weight loss + painless progressive jaundice + Courvoisier's sign = Pancreatic head carcinoma

Jaundice in Special Situations:

  • Post-operative jaundice: Think hemolysis (from blood transfusion), benign postoperative cholestasis (from hypotension + halothane), drug-induced, sepsis-associated
  • Pregnancy (3rd trimester) + jaundice: AFLP (acute fatty liver of pregnancy) vs. intrahepatic cholestasis of pregnancy vs. HELLP - all are emergencies requiring delivery

Step 8: Pearls Summary Table

PearlConcept
Sclerae yellow before skinHigh elastin affinity for bilirubin
Scleral icterus at ~2-3 mg/dLEarlier than skin jaundice
No bilirubinuria in hemolysisUCB is albumin-bound, not filterable
Bilirubin >5 in hemolysis β†’ look for stone or liver diseaseHepatic reserve is massive
Gilbert's β†’ triggered by fasting/stress/illnessUGT1A1 activity ~30% of normal
AST:ALT >2:1 β†’ alcoholic hepatitisMitochondrial AST + pyridoxine deficiency
ALP paradoxically LOW in Wilson's acute liver failureCopper inhibits ALP
ALP + GGT both up β†’ hepatic source confirmedGGT localizes ALP to liver
Courvoisier's sign β†’ painless non-tender palpable GB in jaundiceMalignant biliary obstruction
Charcot's triad = fever + RUQ pain + jaundiceAscending cholangitis - ERCP urgently
Reynolds' pentad = Charcot's + shock + confusionSeptic cholangitis - ICU immediately
Absent urobilinogen in complete obstructionNo bile reaches gut β†’ no enterohepatic cycling
Pale stools + dark urine = post-hepaticConjugated bilirubin backs up + no stercobilin
Wilson's + ALF: low ALPUnique to Wilson's - always check
PT not correcting with vit K β†’ parenchymal failureNot just biliary obstruction

Professor's Closing Framework - The 3 Questions at the Bedside

Whenever you see a jaundiced patient in the ward, ask yourself these three questions in order:
1. Is the bilirubin truly elevated, and in which fraction? (UCB vs CB) β†’ Divides the universe into hemolytic vs. hepatocellular/cholestatic
2. Are other LFTs abnormal? β†’ YES + hepatocellular pattern (↑↑ ALT/AST) β†’ hepatitis/cirrhosis workup β†’ YES + cholestatic pattern (↑↑ ALP) β†’ ultrasound first β†’ extrahepatic vs intrahepatic cholestasis β†’ NO β†’ benign inherited disorder (Gilbert's, Dubin-Johnson) or pure hemolysis
3. What does the full clinical picture tell me? β†’ Urine/stool color, pain, fever, chronicity, stigmata of CLD, lymph nodes, Courvoisier's sign

Sources: Harrison's Principles of Internal Medicine, 22nd Ed (2025); Lippincott Illustrated Reviews: Biochemistry, 8th Ed; Schwartz's Principles of Surgery, 11th Ed; Goldman-Cecil Medicine, International Ed.

Make a presentation summarizing this approach for ward rounds

Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/jaundice-presentation && ls /home/daytona/works…

Writing File

~/jaundice-presentation/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Approach to Jaundice - Ward Rounds";

// ─── PALETTE ──────────────────────────────────────────────────────────────────
const C = {
  bg:       "0D1B2A",   // deep navy (dominant dark)
  panel:    "1A2E45",   // mid navy panel
  card:     "122337",   // card bg
  accent1:  "F5A623",   // amber/gold – jaundice colour
  accent2:  "2BBFA4",   // teal – action/process
  accent3:  "E05C5C",   // coral/red – danger / alerts
  accent4:  "7EB8F7",   // sky blue – info
  white:    "FFFFFF",
  lightgray:"C8D8E8",
  muted:    "8AA5BE",
};

// ─── HELPER: standard slide header bar ────────────────────────────────────────
function addHeader(slide, title, subtitle) {
  // Full-width amber top bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.72,
    fill: { color: C.accent1 }, line: { color: C.accent1 }
  });
  slide.addText(title.toUpperCase(), {
    x: 0.3, y: 0, w: 9.4, h: 0.72,
    fontSize: 18, bold: true, color: C.bg, valign: "middle", margin: 0,
    charSpacing: 2
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.3, y: 0.72, w: 9.4, h: 0.28,
      fontSize: 9, color: C.muted, valign: "middle", italic: true, margin: 0
    });
  }
}

// ─── HELPER: coloured badge ───────────────────────────────────────────────────
function addBadge(slide, text, x, y, w, h, bg, fg) {
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w, h,
    fill: { color: bg }, line: { color: bg }, rectRadius: 0.08
  });
  slide.addText(text, {
    x, y, w, h,
    fontSize: 8.5, bold: true, color: fg || C.white,
    align: "center", valign: "middle", margin: 0
  });
}

// ─── HELPER: pearl box ────────────────────────────────────────────────────────
function addPearl(slide, text, x, y, w, h) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h,
    fill: { color: C.panel },
    line: { color: C.accent1, pt: 1.5 }
  });
  slide.addText([
    { text: "β˜… PEARL  ", options: { bold: true, color: C.accent1, fontSize: 8 } },
    { text: text, options: { color: C.lightgray, fontSize: 8.5 } }
  ], { x: x + 0.1, y, w: w - 0.2, h, valign: "middle", margin: 4 });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };

  // Giant amber accent strip left
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.18, h: 5.625,
    fill: { color: C.accent1 }, line: { color: C.accent1 }
  });

  // Decorative circle top-right
  s.addShape(pres.shapes.OVAL, {
    x: 7.5, y: -1.2, w: 4.2, h: 4.2,
    fill: { color: C.panel, transparency: 40 }, line: { color: C.accent1, pt: 1.5 }
  });

  s.addText("APPROACH TO", {
    x: 0.5, y: 1.0, w: 9, h: 0.7,
    fontSize: 22, color: C.muted, bold: false, charSpacing: 8, margin: 0
  });
  s.addText("JAUNDICE", {
    x: 0.5, y: 1.55, w: 9, h: 1.5,
    fontSize: 72, bold: true, color: C.accent1, charSpacing: 4, margin: 0
  });
  s.addText("A Systematic Ward Round Framework", {
    x: 0.5, y: 3.1, w: 8, h: 0.45,
    fontSize: 15, color: C.lightgray, italic: true, margin: 0
  });

  // Divider
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.5, y: 3.62, w: 5.5, h: 0.04,
    fill: { color: C.accent2 }, line: { color: C.accent2 }
  });

  s.addText("Harrison's 22E  Β·  Schwartz's Surgery 11E  Β·  Lippincott Biochemistry 8E", {
    x: 0.5, y: 3.75, w: 9, h: 0.3,
    fontSize: 9, color: C.muted, margin: 0
  });

  // 3 key concept badges
  const badges = [
    { t: "Pre-Hepatic", c: C.accent3 },
    { t: "Hepatic", c: C.accent2 },
    { t: "Post-Hepatic", c: C.accent4 }
  ];
  badges.forEach((b, i) => {
    addBadge(s, b.t, 0.5 + i * 2.1, 4.3, 1.85, 0.48, b.c, C.white);
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – WHAT IS JAUNDICE? (Definition + Bilirubin pathway)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "What Is Jaundice?", "Definition Β· Bilirubin pathway Β· Clinical threshold");

  // Left column – definition cards
  const defs = [
    { label: "Definition", text: "Yellow discolouration of skin, sclerae & mucous membranes from bilirubin deposition" },
    { label: "Threshold", text: "Normal bilirubin ≀ 1 mg/dL Β· Visible jaundice at 2–3 mg/dL Β· Scleral icterus appears first (elastin affinity)" },
    { label: "Pseudojaundice", text: "Yellow skin WITHOUT scleral icterus = Carotenemia Β· Bilirubin has no affinity for avascular lens β†’ sclerae are spared" },
  ];
  defs.forEach((d, i) => {
    const yy = 1.15 + i * 1.32;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: yy, w: 4.5, h: 1.1,
      fill: { color: C.panel }, line: { color: C.accent2, pt: 1 } });
    s.addText(d.label.toUpperCase(), {
      x: 0.4, y: yy + 0.05, w: 4.3, h: 0.28,
      fontSize: 8, bold: true, color: C.accent2, margin: 0
    });
    s.addText(d.text, {
      x: 0.4, y: yy + 0.3, w: 4.3, h: 0.72,
      fontSize: 9.5, color: C.lightgray, margin: 0, wrap: true
    });
  });

  // Right column – bilirubin pathway steps
  s.addText("BILIRUBIN PATHWAY", {
    x: 5.1, y: 1.1, w: 4.6, h: 0.3,
    fontSize: 9, bold: true, color: C.accent1, charSpacing: 2, margin: 0
  });

  const steps = [
    { n:"1", label:"Production", note:"Heme β†’ UCB in RES (spleen/liver)", col: C.accent3 },
    { n:"2", label:"Transport", note:"UCB bound to albumin in blood (not filterable)", col: C.accent3 },
    { n:"3", label:"Uptake", note:"OATP1B1/1B3 transporters in hepatocyte", col: C.accent2 },
    { n:"4", label:"Conjugation", note:"UCB + glucuronate β†’ CB via UGT1A1", col: C.accent2 },
    { n:"5", label:"Excretion", note:"CB β†’ bile via MRP2 β†’ gut β†’ stercobilin (brown stool)", col: C.accent4 },
  ];
  steps.forEach((st, i) => {
    const yy = 1.48 + i * 0.77;
    // circle number
    s.addShape(pres.shapes.OVAL, { x: 5.1, y: yy, w: 0.38, h: 0.38,
      fill: { color: st.col }, line: { color: st.col } });
    s.addText(st.n, { x: 5.1, y: yy, w: 0.38, h: 0.38,
      fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(st.label, { x: 5.6, y: yy, w: 1.5, h: 0.38,
      fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addText(st.note, { x: 7.2, y: yy, w: 2.5, h: 0.38,
      fontSize: 8.5, color: C.muted, valign: "middle", margin: 0, wrap: true });
    // connector arrow (except last)
    if (i < steps.length - 1) {
      s.addShape(pres.shapes.RECTANGLE, { x: 5.25, y: yy + 0.38, w: 0.08, h: 0.39,
        fill: { color: C.muted }, line: { color: C.muted } });
    }
  });

  // Bottom pearl
  addPearl(s, "Liver daily capacity: >3,000 mg/day Β· Normal production: ~300 mg/day Β· This 10:1 reserve explains why pure hemolysis rarely exceeds 5 mg/dL",
    0.3, 5.05, 9.4, 0.42);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – THE 3-ZONE FRAMEWORK
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "The 3-Zone Framework", "Pre-hepatic Β· Hepatic Β· Post-hepatic");

  const zones = [
    {
      title: "PRE-HEPATIC",
      color: C.accent3,
      mech: "Excess bilirubin production overwhelms conjugation capacity",
      bili: "↑ UCB (indirect)",
      urine: "Urobilinogen ↑↑  |  NO bilirubinuria",
      stool: "Dark (excess stercobilin)",
      causes: ["Hereditary: spherocytosis, SCD, G6PD, PK def.", "Acquired: MAHA (HUS/TTP), PNH, autoimmune", "Malaria, babesiosis", "Ineffective erythropoiesis: B12/folate deficiency"],
    },
    {
      title: "HEPATIC",
      color: C.accent2,
      mech: "Hepatocyte dysfunction at uptake, conjugation or excretion steps",
      bili: "UCB or CB depending on step",
      urine: "Variable – bilirubinuria in severe disease",
      stool: "Variable",
      causes: ["Viral hepatitis A/B/C/D/E, EBV, CMV", "Alcoholic hepatitis (AST:ALT >2:1)", "Drug-induced (APAP, chlorpromazine)", "Autoimmune hepatitis, Wilson's disease", "Gilbert's, Crigler-Najjar, Dubin-Johnson"],
    },
    {
      title: "POST-HEPATIC",
      color: C.accent4,
      mech: "Mechanical CBD obstruction β†’ CB regurgitates into sinusoids",
      bili: "↑↑ CB (direct)",
      urine: "Dark (bilirubinuria) Β· Urobilinogen ABSENT",
      stool: "Pale / clay-coloured",
      causes: ["Choledocholithiasis (colicky RUQ pain)", "Pancreatic head ca. (painless jaundice)", "Cholangiocarcinoma (Klatskin tumour)", "Ascending cholangitis (Charcot's triad)", "Chronic pancreatitis, Mirizzi syndrome"],
    },
  ];

  zones.forEach((z, i) => {
    const x = 0.18 + i * 3.28;
    // Zone card
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.05, w: 3.1, h: 4.3,
      fill: { color: C.card }, line: { color: z.color, pt: 2 } });
    // Title bar
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.05, w: 3.1, h: 0.42,
      fill: { color: z.color }, line: { color: z.color } });
    s.addText(z.title, { x, y: 1.05, w: 3.1, h: 0.42,
      fontSize: 11.5, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

    s.addText("MECHANISM", { x: x + 0.1, y: 1.53, w: 2.9, h: 0.22,
      fontSize: 7, bold: true, color: z.color, margin: 0 });
    s.addText(z.mech, { x: x + 0.1, y: 1.72, w: 2.9, h: 0.42,
      fontSize: 8.5, color: C.lightgray, margin: 0, wrap: true });

    s.addShape(pres.shapes.RECTANGLE, { x: x + 0.1, y: 2.19, w: 2.9, h: 0.02,
      fill: { color: C.muted }, line: { color: C.muted } });

    s.addText("BILIRUBIN", { x: x + 0.1, y: 2.25, w: 2.9, h: 0.2,
      fontSize: 7, bold: true, color: z.color, margin: 0 });
    s.addText(z.bili, { x: x + 0.1, y: 2.43, w: 2.9, h: 0.22,
      fontSize: 8.5, color: C.white, margin: 0 });

    s.addText("URINE / STOOL", { x: x + 0.1, y: 2.72, w: 2.9, h: 0.2,
      fontSize: 7, bold: true, color: z.color, margin: 0 });
    s.addText(z.urine, { x: x + 0.1, y: 2.9, w: 2.9, h: 0.22,
      fontSize: 8, color: C.lightgray, margin: 0 });
    s.addText(z.stool, { x: x + 0.1, y: 3.1, w: 2.9, h: 0.22,
      fontSize: 8, color: C.lightgray, margin: 0 });

    s.addShape(pres.shapes.RECTANGLE, { x: x + 0.1, y: 3.37, w: 2.9, h: 0.02,
      fill: { color: C.muted }, line: { color: C.muted } });

    s.addText("KEY CAUSES", { x: x + 0.1, y: 3.42, w: 2.9, h: 0.2,
      fontSize: 7, bold: true, color: z.color, margin: 0 });
    z.causes.forEach((c, ci) => {
      s.addText("Β· " + c, { x: x + 0.1, y: 3.62 + ci * 0.31, w: 2.9, h: 0.3,
        fontSize: 8, color: C.lightgray, margin: 0, wrap: true });
    });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – DIAGNOSTIC ALGORITHM (Harrison's framework)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "Diagnostic Algorithm", "Harrison's 22E – Fig 52-1 framework");

  // ── Branch 1: ISOLATED BILIRUBIN ELEVATION ──
  // Top box
  s.addShape(pres.shapes.RECTANGLE, { x: 3.3, y: 1.05, w: 3.4, h: 0.6,
    fill: { color: C.panel }, line: { color: C.accent1, pt: 1.5 } });
  s.addText("JAUNDICED PATIENT", { x: 3.3, y: 1.05, w: 3.4, h: 0.6,
    fontSize: 11, bold: true, color: C.accent1, align: "center", valign: "middle", margin: 0 });

  // Arrow down
  s.addShape(pres.shapes.RECTANGLE, { x: 4.96, y: 1.65, w: 0.08, h: 0.3,
    fill: { color: C.muted }, line: { color: C.muted } });

  // Question box
  s.addShape(pres.shapes.RECTANGLE, { x: 2.7, y: 1.95, w: 4.6, h: 0.55,
    fill: { color: C.card }, line: { color: C.accent2, pt: 1 } });
  s.addText("Are other LFTs abnormal?  (ALT Β· AST Β· ALP Β· GGT)", {
    x: 2.7, y: 1.95, w: 4.6, h: 0.55,
    fontSize: 10, color: C.lightgray, align: "center", valign: "middle", margin: 0
  });

  // Left branch: NO – isolated
  s.addShape(pres.shapes.RECTANGLE, { x: 2.7, y: 1.95, w: 0, h: 0 });
  s.addText("NO", { x: 0.5, y: 2.05, w: 0.5, h: 0.28,
    fontSize: 8.5, bold: true, color: C.accent3 });
  // horizontal arrow left
  s.addShape(pres.shapes.RECTANGLE, { x: 0.9, y: 2.2, w: 1.8, h: 0.05,
    fill: { color: C.muted }, line: { color: C.muted } });

  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 2.5, w: 2.5, h: 1.4,
    fill: { color: C.panel }, line: { color: C.accent3, pt: 1.5 } });
  s.addText("ISOLATED BILIRUBIN ↑", { x: 0.2, y: 2.5, w: 2.5, h: 0.35,
    fontSize: 9, bold: true, color: C.accent3, align: "center", valign: "middle", margin: 0 });
  s.addText([
    { text: "Indirect dominant β†’ ", options: { bold: true, color: C.lightgray } },
    { text: "Hemolysis, Gilbert's, Crigler-Najjar, Drugs\n", options: { color: C.muted } },
    { text: "Direct dominant β†’ ", options: { bold: true, color: C.lightgray } },
    { text: "Dubin-Johnson, Rotor syndrome", options: { color: C.muted } },
  ], { x: 0.3, y: 2.9, w: 2.3, h: 1.0, fontSize: 8, margin: 0, wrap: true });

  // Right branch: YES
  s.addText("YES", { x: 9.0, y: 2.05, w: 0.6, h: 0.28,
    fontSize: 8.5, bold: true, color: C.accent2 });
  s.addShape(pres.shapes.RECTANGLE, { x: 7.3, y: 2.2, w: 1.7, h: 0.05,
    fill: { color: C.muted }, line: { color: C.muted } });

  // Hepatocellular box
  s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 2.6, w: 2.1, h: 1.6,
    fill: { color: C.panel }, line: { color: C.accent2, pt: 1.5 } });
  s.addText("HEPATOCELLULAR", { x: 5.2, y: 2.6, w: 2.1, h: 0.35,
    fontSize: 8, bold: true, color: C.accent2, align: "center", valign: "middle", margin: 0 });
  s.addText("↑↑ ALT/AST\nout of proportion\nto ALP", {
    x: 5.3, y: 3.0, w: 1.9, h: 0.55,
    fontSize: 8, color: C.lightgray, margin: 0 });
  s.addText("→ Viral serology\n→ Toxicology\n→ Autoimmune\n→ Ceruloplasmin (<55y)", {
    x: 5.3, y: 3.6, w: 1.9, h: 0.6,
    fontSize: 7.5, color: C.muted, margin: 0 });

  // Cholestatic box
  s.addShape(pres.shapes.RECTANGLE, { x: 7.5, y: 2.6, w: 2.2, h: 1.6,
    fill: { color: C.panel }, line: { color: C.accent4, pt: 1.5 } });
  s.addText("CHOLESTATIC", { x: 7.5, y: 2.6, w: 2.2, h: 0.35,
    fontSize: 8, bold: true, color: C.accent4, align: "center", valign: "middle", margin: 0 });
  s.addText("↑↑ ALP + GGT\nout of proportion\nto ALT/AST", {
    x: 7.6, y: 3.0, w: 2.0, h: 0.55,
    fontSize: 8, color: C.lightgray, margin: 0 });
  s.addText("β†’ Ultrasound first\n  Dilated ducts β†’ ERCP\n  Non-dilated β†’ AMA\n  serologies/biopsy", {
    x: 7.6, y: 3.6, w: 2.0, h: 0.6,
    fontSize: 7.5, color: C.muted, margin: 0 });

  // Bottom section – LFT pattern summary
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 4.35, w: 9.6, h: 0.08,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("BILIRUBIN FRACTIONATION  Β·  ALT/AST  Β·  ALP  Β·  GGT  Β·  ALBUMIN  Β·  PT/INR β€” Order on every jaundiced patient", {
    x: 0.2, y: 4.5, w: 9.6, h: 0.3,
    fontSize: 8.5, color: C.muted, align: "center", margin: 0
  });

  // PT/INR pearls
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 4.85, w: 4.65, h: 0.55,
    fill: { color: C.card }, line: { color: C.accent1, pt: 1 } });
  s.addText("PT corrects with IV Vit K β†’ biliary obstruction (malabsorption)\nPT does NOT correct β†’ hepatocellular synthetic failure", {
    x: 0.3, y: 4.88, w: 4.5, h: 0.5,
    fontSize: 8, color: C.lightgray, margin: 0
  });

  s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 4.85, w: 4.7, h: 0.55,
    fill: { color: C.card }, line: { color: C.accent2, pt: 1 } });
  s.addText("Low albumin β†’ chronic process (cirrhosis, malignancy)\nNormal albumin β†’ acute process (viral hepatitis, choledocholithiasis)", {
    x: 5.2, y: 4.88, w: 4.5, h: 0.5,
    fontSize: 8, color: C.lightgray, margin: 0
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – HISTORY-TAKING PEARLS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "History-Taking", "\"The single most important part of evaluation\" β€” Harrison's 22E");

  const rows = [
    { domain: "Drugs & Toxins", ask: "All Rx, OTC, herbal, anabolic steroids", clue: "Drug-induced liver injury (DILI)", col: C.accent3 },
    { domain: "Alcohol", ask: ">3 drinks/day men, >2/day women; last drink", clue: "Alcoholic hepatitis / cirrhosis", col: C.accent3 },
    { domain: "Parenteral", ask: "IV drugs, tattoos, transfusions, piercings", clue: "Hepatitis B, C", col: C.accent2 },
    { domain: "Travel", ask: "Endemic areas, recent travel", clue: "Hepatitis A/E, malaria, leptospirosis", col: C.accent2 },
    { domain: "Food", ask: "Raw shellfish, contaminated water", clue: "Hepatitis A, E (fecal-oral)", col: C.accent2 },
    { domain: "Pain character", ask: "Colicky vs constant; location", clue: "Colicky β†’ stone; constant β†’ inflammation; none β†’ malignancy", col: C.accent1 },
    { domain: "Urine / Stool", ask: "Dark urine? Pale stools?", clue: "Dark urine + pale stool = post-hepatic (obstructive)", col: C.accent1 },
    { domain: "Associated Sx", ask: "Fever, chills, pruritus, weight loss, arthralgias", clue: "Cholangitis, cholestasis, malignancy, viral prodrome", col: C.accent4 },
    { domain: "Duration", ask: "Days vs weeks vs months", clue: "Acute β†’ viral/toxic; subacute/chronic β†’ cirrhosis/malignancy", col: C.accent4 },
    { domain: "Pregnancy", ask: "Trimester?", clue: "3rd trimester: AFLP, ICP, HELLP β€” all are emergencies", col: C.accent3 },
  ];

  // Table header
  const hdrCols = ["DOMAIN", "ASK SPECIFICALLY", "CLINICAL CLUE"];
  const hdrW = [1.8, 3.6, 3.9];
  const hdrX = [0.25, 2.05, 5.65];
  hdrCols.forEach((h, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: hdrX[i], y: 1.08, w: hdrW[i], h: 0.32,
      fill: { color: C.accent1 }, line: { color: C.accent1 } });
    s.addText(h, { x: hdrX[i], y: 1.08, w: hdrW[i], h: 0.32,
      fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
  });

  rows.forEach((r, i) => {
    const yy = 1.42 + i * 0.38;
    const bg = i % 2 === 0 ? C.panel : C.card;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.25, y: yy, w: 9.55, h: 0.37,
      fill: { color: bg }, line: { color: bg } });
    // Color dot
    s.addShape(pres.shapes.OVAL, { x: 0.3, y: yy + 0.1, w: 0.18, h: 0.18,
      fill: { color: r.col }, line: { color: r.col } });
    s.addText(r.domain, { x: 0.52, y: yy, w: 1.48, h: 0.37,
      fontSize: 8.5, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addText(r.ask, { x: 2.05, y: yy, w: 3.55, h: 0.37,
      fontSize: 8, color: C.lightgray, valign: "middle", margin: 4 });
    s.addText(r.clue, { x: 5.65, y: yy, w: 3.85, h: 0.37,
      fontSize: 8, color: C.muted, valign: "middle", margin: 4 });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – PHYSICAL EXAMINATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "Physical Examination", "Stigmata of CLD Β· Abdominal signs Β· Lymph nodes");

  // Left column – Stigmata CLD
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.05, w: 3.1, h: 0.35,
    fill: { color: C.accent3 }, line: { color: C.accent3 } });
  s.addText("STIGMATA OF CHRONIC LIVER DISEASE", { x: 0.2, y: 1.05, w: 3.1, h: 0.35,
    fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const cld = [
    ["Spider nevi (>5, SVC territory)", "Estrogen excess (impaired hepatic metabolism)"],
    ["Palmar erythema", "Same oestrogen mechanism"],
    ["Gynaecomastia / testicular atrophy", "Oestrogen-androgen imbalance"],
    ["Caput medusae", "Portal HTN β†’ umbilical vein recanalization"],
    ["Dupuytren's contracture", "Alcoholic liver disease"],
    ["Parotid enlargement", "Alcohol use"],
    ["Terry's nails / leukonychia", "Hypoalbuminaemia"],
    ["Clubbing", "Hepatopulmonary syndrome"],
    ["Asterixis (flapping tremor)", "Hepatic encephalopathy"],
  ];
  cld.forEach((row, i) => {
    const yy = 1.45 + i * 0.41;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: yy, w: 3.1, h: 0.39,
      fill: { color: i % 2 === 0 ? C.panel : C.card }, line: { color: i % 2 === 0 ? C.panel : C.card } });
    s.addText("Β· " + row[0], { x: 0.28, y: yy + 0.01, w: 3.0, h: 0.2,
      fontSize: 7.5, bold: true, color: C.lightgray, margin: 0 });
    s.addText(row[1], { x: 0.28, y: yy + 0.2, w: 3.0, h: 0.18,
      fontSize: 7, color: C.muted, italic: true, margin: 0 });
  });

  // Middle column – Abdominal signs
  s.addShape(pres.shapes.RECTANGLE, { x: 3.5, y: 1.05, w: 3.2, h: 0.35,
    fill: { color: C.accent2 }, line: { color: C.accent2 } });
  s.addText("ABDOMINAL FINDINGS", { x: 3.5, y: 1.05, w: 3.2, h: 0.35,
    fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const abd = [
    ["Smooth tender hepatomegaly", "Viral/alcoholic hepatitis, congestive"],
    ["Hard nodular hepatomegaly", "Malignancy, late cirrhosis"],
    ["Enlarged left lobe at xiphoid", "Cirrhosis (right lobe shrinks, left hypertrophies)"],
    ["Splenomegaly", "Portal HTN, hemolysis, haem. malignancy"],
    ["Murphy's sign +ve", "Acute cholecystitis"],
    ["Palpable non-tender GB", "Courvoisier's sign β†’ malignant obstruction"],
    ["Ascites + jaundice", "Cirrhosis or peritoneal malignancy"],
  ];
  abd.forEach((row, i) => {
    const yy = 1.45 + i * 0.51;
    s.addShape(pres.shapes.RECTANGLE, { x: 3.5, y: yy, w: 3.2, h: 0.49,
      fill: { color: i % 2 === 0 ? C.panel : C.card }, line: { color: i % 2 === 0 ? C.panel : C.card } });
    s.addText("Β· " + row[0], { x: 3.58, y: yy + 0.01, w: 3.1, h: 0.24,
      fontSize: 8, bold: true, color: C.lightgray, margin: 0 });
    s.addText(row[1], { x: 3.58, y: yy + 0.24, w: 3.1, h: 0.22,
      fontSize: 7.5, color: C.muted, italic: true, margin: 0 });
  });

  // Right column – Pearls
  s.addShape(pres.shapes.RECTANGLE, { x: 6.9, y: 1.05, w: 2.9, h: 0.35,
    fill: { color: C.accent4 }, line: { color: C.accent4 } });
  s.addText("KEY CLINICAL PEARLS", { x: 6.9, y: 1.05, w: 2.9, h: 0.35,
    fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const pearls = [
    { t: "Courvoisier's Law", b: "Palpable non-tender GB + jaundice β†’ malignant obstruction (NOT stones; stones cause fibrosis β†’ shrunken GB)" },
    { t: "Virchow's node", b: "Left supraclavicular LN = Troisier's sign β†’ GI/abdominal malignancy" },
    { t: "Sister Mary Joseph's", b: "Periumbilical nodule β†’ peritoneal metastasis" },
    { t: "Temporal wasting", b: "Long-standing disease: pancreatic cancer or cirrhosis" },
    { t: "JVD + pulsatile liver", b: "Right heart failure as cause of congestive hepatopathy" },
  ];
  pearls.forEach((p, i) => {
    const yy = 1.45 + i * 0.8;
    s.addShape(pres.shapes.RECTANGLE, { x: 6.9, y: yy, w: 2.9, h: 0.76,
      fill: { color: C.panel }, line: { color: C.accent4, pt: 1 } });
    s.addText("β˜… " + p.t, { x: 7.0, y: yy + 0.04, w: 2.7, h: 0.25,
      fontSize: 8.5, bold: true, color: C.accent4, margin: 0 });
    s.addText(p.b, { x: 7.0, y: yy + 0.28, w: 2.7, h: 0.44,
      fontSize: 7.5, color: C.lightgray, margin: 0, wrap: true });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – LFT PATTERN INTERPRETATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "LFT Pattern Interpretation", "Hepatocellular vs Cholestatic β€” critical distinction");

  // HEPATOCELLULAR PATTERN
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.05, w: 4.6, h: 0.38,
    fill: { color: C.accent2 }, line: { color: C.accent2 } });
  s.addText("HEPATOCELLULAR PATTERN", { x: 0.2, y: 1.05, w: 4.6, h: 0.38,
    fontSize: 10, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const hcRows = [
    ["ALT / AST", "↑↑↑ (disproportionate to ALP)"],
    ["ALP", "Normal or mildly ↑"],
    ["Bilirubin", "↑ Mixed (CB + UCB)"],
    ["Albumin", "↓ in chronic disease"],
    ["PT/INR", "↑ – synthetic failure"],
    ["AST:ALT ratio", ">2:1 = Alcoholic hepatitis (De Ritis ratio)"],
    ["AST:ALT >10:1", "Ischaemic hepatitis or APAP toxicity"],
    ["ALP paradoxically LOW", "Wilson's disease acute liver failure (Cu inhibits ALP)"],
  ];
  hcRows.forEach((row, i) => {
    const yy = 1.5 + i * 0.42;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: yy, w: 4.6, h: 0.4,
      fill: { color: i % 2 === 0 ? C.panel : C.card }, line: { color: i % 2 === 0 ? C.panel : C.card } });
    s.addText(row[0], { x: 0.3, y: yy, w: 1.7, h: 0.4,
      fontSize: 8.5, bold: true, color: C.lightgray, valign: "middle", margin: 0 });
    s.addText(row[1], { x: 2.1, y: yy, w: 2.6, h: 0.4,
      fontSize: 8.5, color: C.muted, valign: "middle", margin: 0 });
  });

  // CHOLESTATIC PATTERN
  s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 1.05, w: 4.6, h: 0.38,
    fill: { color: C.accent4 }, line: { color: C.accent4 } });
  s.addText("CHOLESTATIC PATTERN", { x: 5.2, y: 1.05, w: 4.6, h: 0.38,
    fontSize: 10, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const cholRows = [
    ["ALP + GGT", "↑↑↑ (disproportionate to ALT/AST)"],
    ["ALT / AST", "Normal or mildly ↑"],
    ["Bilirubin", "↑↑ CB (direct) dominant"],
    ["Urine", "Dark (bilirubinuria)"],
    ["Stool", "Pale / clay-coloured (post-hepatic)"],
    ["ALP alone ↑, GGT normal", "Bone source β€” NOT hepatic (confirm with GGT)"],
    ["GGT alone ↑", "Alcohol or enzyme-inducing drugs (no structural damage)"],
    ["Next step", "Ultrasound β†’ dilated ducts? β†’ MRCP/ERCP"],
  ];
  cholRows.forEach((row, i) => {
    const yy = 1.5 + i * 0.42;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: yy, w: 4.6, h: 0.4,
      fill: { color: i % 2 === 0 ? C.panel : C.card }, line: { color: i % 2 === 0 ? C.panel : C.card } });
    s.addText(row[0], { x: 5.3, y: yy, w: 2.0, h: 0.4,
      fontSize: 8.5, bold: true, color: C.lightgray, valign: "middle", margin: 0 });
    s.addText(row[1], { x: 7.4, y: yy, w: 2.3, h: 0.4,
      fontSize: 8.5, color: C.muted, valign: "middle", margin: 0 });
  });

  // divider
  s.addShape(pres.shapes.RECTANGLE, { x: 5.0, y: 1.0, w: 0.04, h: 4.4,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });

  // Bottom severity tests
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 5.05, w: 9.6, h: 0.38,
    fill: { color: C.card }, line: { color: C.accent1, pt: 1 } });
  s.addText("SEVERITY:  Child-Pugh score  Β·  MELD score (bilirubin + creatinine + INR)  Β·  Maddrey DF = 4.6Γ—(PTβˆ’control) + bilirubin  [>32 β†’ consider steroids in AH]", {
    x: 0.3, y: 5.05, w: 9.4, h: 0.38,
    fontSize: 8, color: C.accent1, valign: "middle", margin: 0, bold: false
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – URINE / STOOL DIPSTICK TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "Urine & Stool Analysis", "Most underused bedside test β€” urine dipstick");

  // Big table
  const headers = ["", "PRE-HEPATIC\n(Hemolysis)", "HEPATIC\n(Hepatocellular)", "POST-HEPATIC\n(Obstruction)"];
  const hColors = [C.panel, C.accent3, C.accent2, C.accent4];

  const tRows = [
    ["Serum Bilirubin type", "↑ UCB (indirect)", "↑ Mixed CB+UCB", "↑↑ CB (direct)"],
    ["Urine bilirubin (dipstick)", "ABSENT βœ—", "Present ↑", "Present ↑↑"],
    ["Urine urobilinogen", "↑↑ (excess)", "Variable (↑ or ↓)", "ABSENT βœ—"],
    ["Stool colour", "Dark brown (↑ stercobilin)", "Normal β†’ pale", "Pale / clay βœ—"],
    ["Why no bilirubinuria\nin hemolysis?", "UCB bound to albumin → too large to filter", "CB is water-soluble\n→ filtered by kidney", "CB water-soluble\n→ filtered by kidney"],
    ["Why absent urobilinogen\nin obstruction?", "–", "–", "No bile reaches gut\nβ†’ no enterohepatic\ncycling"],
  ];

  // Header row
  const colX = [0.2, 2.7, 5.3, 7.7];
  const colW = [2.4, 2.5, 2.35, 2.1];
  headers.forEach((h, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: colX[i], y: 1.05, w: colW[i], h: 0.48,
      fill: { color: hColors[i] }, line: { color: hColors[i] } });
    s.addText(h, { x: colX[i], y: 1.05, w: colW[i], h: 0.48,
      fontSize: 9, bold: true, color: i === 0 ? C.muted : C.bg, align: "center", valign: "middle", margin: 0 });
  });

  tRows.forEach((row, ri) => {
    const yy = 1.57 + ri * 0.62;
    const rowBg = ri % 2 === 0 ? C.panel : C.card;
    colX.forEach((cx, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: cx, y: yy, w: colW[ci], h: 0.6,
        fill: { color: rowBg }, line: { color: rowBg } });
      const textColor = ci === 0 ? C.lightgray : (row[ci].includes("ABSENT") ? C.accent3 : C.muted);
      s.addText(row[ci], { x: cx + 0.08, y: yy, w: colW[ci] - 0.16, h: 0.6,
        fontSize: 8.5, color: textColor, valign: "middle", margin: 0,
        bold: ci === 0 });
    });
  });

  // Pearl
  addPearl(s, "Complete CBD obstruction β†’ urobilinogen ABSENT in both urine and stool. Dark urine from CB (water-soluble) + zero urobilinogen = powerful clue for complete mechanical obstruction",
    0.2, 5.27, 9.6, 0.2);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – CRITICAL CLINICAL SYNDROMES
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "Critical Clinical Syndromes", "Pattern recognition on the ward");

  const syndromes = [
    {
      cat: "EMERGENCY",
      color: C.accent3,
      items: [
        { title: "Charcot's Triad", body: "Fever + RUQ pain + Jaundice → Ascending cholangitis\n→ IV antibiotics + urgent ERCP" },
        { title: "Reynolds' Pentad", body: "Charcot's + Shock + Confusion → Septic cholangitis\n→ ICU + emergency ERCP/PTC" },
        { title: "AFLP / HELLP", body: "3rd trimester jaundice → Acute fatty liver of pregnancy or HELLP\n→ Immediate delivery (both are obstetric emergencies)" },
      ]
    },
    {
      cat: "ACUTE JAUNDICE",
      color: C.accent1,
      items: [
        { title: "Fever + travel + splenomegaly", body: "Malaria β†’ urgent thick + thin blood film\nRepeat if first negative" },
        { title: "Leptospirosis (Weil's disease)", body: "Conjunctival suffusion + muscle tenderness + jaundice + AKI\n+ epidemiological exposure (sewage, flooding, water sports)" },
        { title: "Viral hepatitis prodrome", body: "Arthralgias/myalgias β†’ jaundice β†’ HAV, HBV (seronegative window)\nAlways check IgM anti-HAV and HBsAg + anti-HBc IgM" },
      ]
    },
    {
      cat: "CHRONIC / PROGRESSIVE",
      color: C.accent4,
      items: [
        { title: "Painless progressive + weight loss", body: "Pancreatic head Ca or ampullary Ca\nCourvoisier's sign Β± CA 19-9 ↑ β†’ CT + ERCP/EUS" },
        { title: "Middle-aged woman + pruritus + AMA+", body: "Primary biliary cholangitis (PBC)\nALP ↑↑, AMA >1:40, antimitochondrial Ab M2 subtype" },
        { title: "Young + IBD + strictures on MRCP", body: "Primary sclerosing cholangitis (PSC)\npANCA Β±, beads-on-string on cholangiography; risk of CCA" },
        { title: "<55 yr + neuro/psych + KF rings + low ALP", body: "Wilson's disease β†’ ceruloplasmin ↓, 24h urine Cu ↑\nLow ALP in acute WD liver failure = red flag" },
      ]
    },
  ];

  let col = 0;
  let colXarr = [0.2, 3.45, 6.6];
  let colWw = 3.05;
  syndromes.forEach((cat, ci) => {
    const cx = colXarr[ci];
    // Category header
    s.addShape(pres.shapes.RECTANGLE, { x: cx, y: 1.05, w: colWw, h: 0.35,
      fill: { color: cat.color }, line: { color: cat.color } });
    s.addText(cat.cat, { x: cx, y: 1.05, w: colWw, h: 0.35,
      fontSize: 9, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

    cat.items.forEach((item, ii) => {
      const yy = 1.45 + ii * 1.34;
      s.addShape(pres.shapes.RECTANGLE, { x: cx, y: yy, w: colWw, h: 1.28,
        fill: { color: C.panel }, line: { color: cat.color, pt: 1 } });
      s.addText(item.title, { x: cx + 0.1, y: yy + 0.06, w: colWw - 0.2, h: 0.28,
        fontSize: 9, bold: true, color: cat.color, margin: 0 });
      s.addText(item.body, { x: cx + 0.1, y: yy + 0.35, w: colWw - 0.2, h: 0.88,
        fontSize: 8, color: C.lightgray, margin: 0, wrap: true });
    });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – GENETIC / ISOLATED HYPERBILIRUBINAEMIA
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "Isolated Hyperbilirubinaemia β€” Genetic Syndromes", "No other LFT abnormality");

  const conditions = [
    {
      name: "GILBERT'S SYNDROME",
      color: C.accent2,
      bili: "UCB ↑ (<6 mg/dL)",
      defect: "UGT1A1 activity ~30% of normal",
      trigger: "Fasting, stress, illness, alcohol",
      incidence: "4–7% of population (M:F = 7:1)",
      clue: "Benign, cardioprotective (UCB is antioxidant). Fasting test confirms: 48h fast β†’ bilirubin doubles",
      treatment: "Reassurance only",
    },
    {
      name: "CRIGLER-NAJJAR TYPE I",
      color: C.accent3,
      bili: "UCB >>20 mg/dL",
      defect: "Complete UGT1A1 absence",
      trigger: "β€”",
      incidence: "Very rare; neonates",
      clue: "Kernicterus inevitable. No response to phenobarbitone. Fatal without liver transplant",
      treatment: "Liver transplant (only cure)",
    },
    {
      name: "CRIGLER-NAJJAR TYPE II",
      color: C.accent1,
      bili: "UCB 6–20 mg/dL",
      defect: "Partial UGT1A1 deficiency",
      trigger: "β€”",
      incidence: "Rare; neonates/infants",
      clue: "Responds to phenobarbitone (induces residual UGT activity). Less severe than type I",
      treatment: "Phenobarbitone; phototherapy",
    },
    {
      name: "DUBIN-JOHNSON",
      color: C.accent4,
      bili: "CB ↑ (asymptomatic)",
      defect: "MRP2 (ABCC2) mutation β†’ can't excrete CB into bile",
      trigger: "OCP, illness",
      incidence: "Rare; any age",
      clue: "Black liver pigment on biopsy (melanin-like). Coproporphyrin I in urine ↑↑. Benign",
      treatment: "Reassurance",
    },
    {
      name: "ROTOR SYNDROME",
      color: C.muted,
      bili: "CB ↑ (asymptomatic)",
      defect: "OATP1B1/1B3 deficiency β†’ impaired hepatic CB reuptake",
      trigger: "β€”",
      incidence: "Very rare",
      clue: "Normal liver biopsy (vs Dubin-Johnson). Coproporphyrin III in urine ↑↑. Benign",
      treatment: "Reassurance",
    },
  ];

  conditions.forEach((c, i) => {
    const x = 0.15 + (i % 3) * 3.3;
    const y = i < 3 ? 1.05 : 3.35;
    const w = 3.05;
    const h = i < 3 ? 2.15 : 2.15;

    s.addShape(pres.shapes.RECTANGLE, { x, y, w, h,
      fill: { color: C.card }, line: { color: c.color, pt: 1.5 } });
    s.addShape(pres.shapes.RECTANGLE, { x, y, w, h: 0.32,
      fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.name, { x, y, w, h: 0.32,
      fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

    const rows = [
      ["Bilirubin", c.bili],
      ["Defect", c.defect],
      ["Trigger", c.trigger],
      ["Clue", c.clue],
      ["Rx", c.treatment],
    ];
    rows.forEach((r, ri) => {
      s.addText(r[0] + ":", { x: x + 0.1, y: y + 0.36 + ri * 0.34, w: 0.65, h: 0.32,
        fontSize: 7.5, bold: true, color: c.color, margin: 0 });
      s.addText(r[1], { x: x + 0.78, y: y + 0.36 + ri * 0.34, w: w - 0.88, h: 0.32,
        fontSize: 7.5, color: C.lightgray, margin: 0, wrap: true });
    });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – THE 3 BEDSIDE QUESTIONS + SUMMARY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "The 3 Bedside Questions", "Ask these on every jaundiced patient β€” in order");

  // Three large question cards
  const questions = [
    {
      n: "1",
      q: "Which fraction is elevated?",
      a: "UCB dominant (indirect) β†’ Pre-hepatic or hepatic conjugation defect\nCB dominant (direct) β†’ Hepatic excretion defect or post-hepatic obstruction",
      color: C.accent3,
    },
    {
      n: "2",
      q: "Are other LFTs abnormal?",
      a: "YES + ALT/AST ↑↑ β†’ Hepatocellular (hepatitis, cirrhosis)\nYES + ALP ↑↑ β†’ Cholestatic β†’ USS first\nNO β†’ Benign isolated (Gilbert's, hemolysis)",
      color: C.accent2,
    },
    {
      n: "3",
      q: "What does the full clinical picture say?",
      a: "Urine/stool colour Β· Pain character Β· Fever Β· CLD signs Β· Courvoisier's Β· Lymph nodes Β· Weight loss",
      color: C.accent4,
    },
  ];

  questions.forEach((q, i) => {
    const yy = 1.05 + i * 1.42;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: yy, w: 9.6, h: 1.35,
      fill: { color: C.panel }, line: { color: q.color, pt: 2 } });
    // Number circle
    s.addShape(pres.shapes.OVAL, { x: 0.35, y: yy + 0.3, w: 0.72, h: 0.72,
      fill: { color: q.color }, line: { color: q.color } });
    s.addText(q.n, { x: 0.35, y: yy + 0.3, w: 0.72, h: 0.72,
      fontSize: 22, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
    s.addText(q.q, { x: 1.22, y: yy + 0.1, w: 8.4, h: 0.42,
      fontSize: 13, bold: true, color: q.color, margin: 0 });
    s.addText(q.a, { x: 1.22, y: yy + 0.54, w: 8.3, h: 0.72,
      fontSize: 9, color: C.lightgray, margin: 0, wrap: true });
  });

  // Source footer
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.25, w: 10, h: 0.375,
    fill: { color: C.card }, line: { color: C.card } });
  s.addText("Sources: Harrison's Principles of Internal Medicine 22E (2025) Β· Schwartz's Principles of Surgery 11E Β· Lippincott Illustrated Reviews Biochemistry 8E Β· Goldman-Cecil Medicine", {
    x: 0.2, y: 5.27, w: 9.6, h: 0.33,
    fontSize: 7, color: C.muted, valign: "middle", margin: 0, italic: true
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 – CLINICAL PEARLS RAPID-FIRE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.bg };
  addHeader(s, "Clinical Pearls β€” Rapid Fire", "High-yield facts for ward rounds and exams");

  const pearls = [
    { p: "Sclerae β†’ skin", d: "Scleral icterus appears before skin jaundice (elastin affinity)" },
    { p: "No bilirubinuria in hemolysis", d: "UCB is albumin-bound, molecular weight too large to pass glomerular filtration" },
    { p: ">5 mg/dL in hemolysis", d: "Look for concomitant liver disease or pigment gallstones (30% in SCD)" },
    { p: "Gilbert's fasting test", d: "48h fast β†’ bilirubin doubles; benign; 4-7% population" },
    { p: "AST:ALT >2:1", d: "Alcoholic hepatitis (De Ritis ratio): mitochondrial AST + pyridoxine deficiency ↓ ALT" },
    { p: "ALP low in Wilson's ALF", d: "Copper directly inhibits ALP β€” unique red flag for Wilson's in acute liver failure" },
    { p: "GGT confirms ALP source", d: "ALP↑ + GGT↑ = hepatic; ALP↑ + GGT normal = bone/pregnancy" },
    { p: "Courvoisier's", d: "Painless palpable GB + jaundice β†’ malignant biliary obstruction (stones = fibrosed GB)" },
    { p: "Charcot's β†’ ERCP", d: "Fever + RUQ pain + jaundice = ascending cholangitis; Reynolds' pentad adds shock + confusion" },
    { p: "PT + Vit K test", d: "PT corrects = biliary; PT unchanged = hepatocellular synthetic failure" },
    { p: "Absent urobilinogen", d: "Complete CBD obstruction β†’ no bile in gut β†’ no enterohepatic cycling" },
    { p: "Pseudojaundice rule", d: "Yellow skin without scleral icterus = carotenemia, not jaundice" },
  ];

  // 2-column layout
  const half = Math.ceil(pearls.length / 2);
  pearls.forEach((p, i) => {
    const col = i < half ? 0 : 1;
    const row = i < half ? i : i - half;
    const x = col === 0 ? 0.2 : 5.1;
    const y = 1.12 + row * 0.57;
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 4.7, h: 0.5,
      fill: { color: C.panel }, line: { color: row % 2 === 0 ? C.accent1 : C.accent2, pt: 1 } });
    s.addText("β˜… " + p.p, { x: x + 0.1, y, w: 4.5, h: 0.22,
      fontSize: 8.5, bold: true, color: row % 2 === 0 ? C.accent1 : C.accent2, margin: 0 });
    s.addText(p.d, { x: x + 0.1, y: y + 0.22, w: 4.5, h: 0.26,
      fontSize: 8, color: C.lightgray, margin: 0 });
  });
}


// ── WRITE OUTPUT ──────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/jaundice-presentation/Approach_to_Jaundice_Ward_Rounds.pptx" })
  .then(() => console.log("Done: Approach_to_Jaundice_Ward_Rounds.pptx"))
  .catch(err => { console.error(err); process.exit(1); });
Running Command

cd /home/daytona/workspace/jaundice-presentation && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/jaundice-presentation/

Your presentation is ready - 416 KB, 12 professionally designed slides:

Approach to Jaundice Ward Rounds

Presentation Β· PPTX


What's inside (12 slides):
#SlideContent
1TitleBold amber-on-navy design with zone badges
2What Is Jaundice?Definition, threshold, pseudojaundice rule, 5-step bilirubin pathway
3The 3-Zone FrameworkPre-hepatic / Hepatic / Post-hepatic cards side-by-side with mechanism, bilirubin type, urine/stool, causes
4Diagnostic AlgorithmHarrison's Fig 52-1 framework - isolated vs combined LFT elevation, hepatocellular vs cholestatic branching
5History-Taking10-row table: domain, what to ask, clinical clue
6Physical Examination3 columns - CLD stigmata, abdominal signs, key pearls (Courvoisier's, Virchow's, Sister Mary Joseph's)
7LFT Pattern InterpretationHepatocellular vs cholestatic side-by-side; De Ritis ratio; Wilson's low-ALP pearl; Maddrey DF
8Urine & Stool AnalysisFull comparison table; why no bilirubinuria in hemolysis; absent urobilinogen in obstruction
9Critical Clinical SyndromesEmergency (Charcot's, Reynolds', AFLP), Acute, Chronic - pattern recognition column layout
10Genetic SyndromesGilbert's, Crigler-Najjar I/II, Dubin-Johnson, Rotor - structured cards
113 Bedside QuestionsThe master framework as 3 large numbered cards
12Clinical Pearls Rapid-Fire12 high-yield pearls in 2-column layout
Design: Deep navy background with amber/gold accent (reinforcing the jaundice theme), teal for processes, coral for emergencies, sky-blue for information. Sourced from Harrison's 22E, Schwartz's Surgery 11E, and Lippincott Biochemistry 8E.

I have uploaded our faculty pdf. Teach with respect to it. Can you be my medicine Professor and teach me how to Approach to stroke systematically in a medical ward. Teach me the insight of clinical pearls with pathophysiological reasoning for each concept.

Reading File
Running Command

python3 -c " import pdfplumber path = '/home/daytona/workspace/attachments/fdc0f…

Running Command

python3 -c " import pdfplumber path = '/home/daytona/workspace/attachments/fdc0f…

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Loading Image
Reading File
Finding Sources
Reading File
Finding Sources
I now have everything needed - the complete faculty PDF (all 10 pages) plus rich textbook content from Fuster & Hurst's The Heart 15E, Neuroanatomy through Clinical Cases 3E, and Bradley & Daroff's Neurology in Clinical Practice. Let me now deliver the full lecture.

🧠 Professor's Ward Round Lecture: Systematic Approach to Stroke

Teaching based on your faculty PDF + Fuster & Hurst's The Heart 15E, Bradley & Daroff's Neurology in Clinical Practice, Neuroanatomy through Clinical Cases 3E

Opening Case (From Your Faculty PDF)

"Mr. X, 65-year-old father of 3 children, known hypertensive and diabetic, presented with sudden onset left-sided face, arm, and leg weakness for 2 hours duration."
This one sentence already tells you the most likely diagnosis. Let me show you exactly why - systematically, with the reasoning behind every step.

THE MASTER DEFINITION - Why "Sudden" Is Everything

Stroke = a focal (or global) neurological deficit due to a vascular cause that lasts more than 24 hours (or produces permanent deficit/death within 24 hours).
Clinical Pearl #1 - "Sudden" Is Your Single Most Important Word: Stroke produces instantaneous maximal deficit at onset. The brain has no pain receptors in its parenchyma - so you cannot feel your neurons dying. What you feel is the loss of function they were performing. The moment perfusion stops, the function stops - hence the abrupt onset.
Compare this to a tumour (gradual weeks-months), abscess (days of fever then focal deficit), or subdural haematoma (progressive over days after trauma). The temporal profile alone narrows your differential enormously.
Pathophysiological reasoning: Normal cerebral blood flow (CBF) = 50 mL/100g brain/min. When CBF drops below ~20 mL/100g/min - neurons cease to function (ischaemic penumbra - your salvageable zone). Below ~10 mL/100g/min - irreversible cell death begins within minutes (infarct core). This 2-zone concept explains the entire rationale for time-critical therapy.

STEP 1: THE FIRST 30 SECONDS AT THE BEDSIDE

Your Faculty PDF says: "Either unilateral or bilateral weakness - don't say it's stroke if they come with bilateral weakness."
This is a red-flag rule you must internalize.
Clinical Pearl #2 - Unilateral vs. Bilateral Weakness:
FindingImplication
Unilateral face + arm + leg weaknessContralateral hemisphere or upper brainstem
Bilateral weaknessNOT a typical hemispheric stroke - think: bilateral strokes (locked-in syndrome), metabolic encephalopathy, Guillan-BarrΓ©, spinal cord
Face spared, arm + leg weaknessParasagittal lesion (ACA territory, venous sinus thrombosis)
Leg > arm weaknessACA territory
Arm > leg weaknessMCA territory
Pathophysiology: The motor homunculus is arranged in the cortex - the leg area sits medially (ACA supply), the arm and face laterally (MCA supply). A single unilateral lesion causes contralateral hemiparesis because corticospinal fibres cross at the medullary pyramids. Bilateral weakness requires either bilateral cortical lesions or a single lesion affecting both pathways below their crossing point (e.g., upper cervical cord, brainstem).

STEP 2: IDENTIFYING THE VASCULAR TERRITORY (Circulation Type)

Your faculty PDF divides this into 3 circulation types. This is one of the most powerful clinical tools at the bedside - it tells you which artery is involved before any imaging.

Anterior Circulation (Internal Carotid β†’ MCA/ACA)

Symptoms to ask for:
  • Face, arm, leg weakness (contralateral UMN type)
  • Higher cortical dysfunction:
    • Language/speech - Broca's (dominant frontal, MCA upper division): non-fluent aphasia, good comprehension
    • Wernicke's (dominant temporal, MCA lower division): fluent aphasia, poor comprehension - patient sounds like they are speaking nonsense
    • Memory - hippocampal, PCA territory
    • Calculation, decision-making, spatial awareness - parietal lobe
Clinical Pearl #3 - Aphasia Localises to the Dominant Hemisphere: Left hemisphere is dominant in >95% of right-handed people and ~70% of left-handed people. So left MCA territory stroke = aphasia. Right MCA territory stroke = neglect (patient ignores left side of space), anosognosia (denial of deficit), constructional apraxia. Ask the patient to read a sentence aloud, name objects, and repeat a phrase - these 3 tasks screen the entire language circuit.

Posterior Circulation (Vertebrobasilar β†’ PICA/AICA/SCA/PCA)

The "D-V-F" triad of posterior circulation: Ask specifically for:
  • Diplopia (CN III, IV, VI nuclei - brainstem)
  • Vertigo (vestibular nuclei in medulla/pons)
  • Facial numbness + weakness (CN V, VII nuclei - pons)
  • Dysphagia and nasal regurgitation (CN IX, X - nucleus ambiguus, medulla)
  • Slurring of speech (dysarthria)
  • Imbalance and unsteadiness (cerebellar pathways)
Clinical Pearl #4 - Crossed Findings = Posterior Circulation Until Proven Otherwise: A face weakness on ONE side + limb weakness on the OPPOSITE side (crossed signs) is pathognomonic of a brainstem lesion. Why? Because cranial nerve nuclei are ipsilateral to the lesion, while the corticospinal and spinothalamic tracts cross below. The brainstem is the only place where you can get a lesion hitting both before they cross, producing this crossed pattern.
Classic example: Lateral Medullary Syndrome (Wallenberg syndrome) - PICA infarct:
  • Ipsilateral: facial sensory loss (CN V), palatal palsy/dysphagia (CN IX/X), Horner's syndrome (descending sympathetics), cerebellar ataxia
  • Contralateral: body spinothalamic sensory loss (crossed fibres)
  • SPARED: corticospinal tract (motor is intact - patient is NOT hemiplegic)
Examination pearl: The patient with Wallenberg's walks into the room, veers to one side, has no limb weakness, but cannot swallow properly - it looks deceptively mild but is a posterior circulation stroke.

Lacunar Circulation (Deep Penetrating Arteries)

These small perforating arteries arise directly from large parent arteries (lenticulostriate from MCA, thalamoperforators from PCA, paramedian pontine from basilar) with no collateral supply:
Deep penetrating arteries prone to lipohyalinosis - Fuster & Hurst's The Heart 15E
Deep penetrating arteries. Occlusion β†’ lacunar infarct. Rupture β†’ intracerebral haemorrhage (ICH). (Fuster & Hurst's The Heart, 15E)
Classic Lacunar Syndromes (Neuroanatomy through Clinical Cases 3E):
SyndromeClinical FeaturesLocationArtery
Pure Motor HemiparesisFace + arm + leg weakness, NO sensory loss, NO cortical signsPosterior limb internal capsule / ventral ponsLenticulostriate / pontine perforators
Pure Sensory StrokeAll modalities sensory loss, face + bodyThalamus (VPL + VPM nuclei)Thalamoperforators
Sensorimotor StrokeCombined aboveThalamocapsularThalamoperforators
Dysarthria-Clumsy HandDysarthria + hand clumsinessInternal capsule / ponsLenticulostriate
Ataxic HemiparesisIpsilateral weakness + ipsilateral ataxiaPons / internal capsulePontine perforators
Clinical Pearl #5 - The Key Feature of Lacunar Strokes = No Cortical Signs: Lacunar strokes classically produce pure motor, pure sensory, or combined syndromes with an absolute absence of cortical features: no aphasia, no neglect, no hemianopia, no seizures, no impaired consciousness. If any cortical sign is present, this is NOT a lacunar stroke - re-examine your localization. This rule is critical because management differs.
Pathophysiology: Lipohyalinosis and microaneurysm formation (Charcot-Bouchard microaneurysms) in the walls of these small penetrating arteries are caused by chronic hypertension and diabetes. The same vessels that occlude to cause lacunar infarcts will rupture to cause deep haemorrhages (basal ganglia, thalamic, pontine ICH). This is why HTN control is the single most important intervention in lacunar disease prevention.

STEP 3: DETERMINING THE AETIOLOGY

Your faculty PDF breaks aetiology into: Atherosclerosis, Cardioembolism, Vasculitis, Thrombophilia for ischaemic stroke, and separately Haemorrhagic stroke.
This maps to the TOAST classification (Fuster & Hurst 15E) - the internationally used framework:

1. Large Artery Atherosclerosis

Pathophysiology: Atherosclerotic plaque at a major artery (carotid bifurcation, proximal MCA, vertebral origin, basilar) either:
  • (a) Ruptures β†’ in-situ thrombosis β†’ large territory infarct
  • (b) Embolises plaque fragments distally β†’ artery-to-artery embolism
History clues your faculty asks you to get:
  • DM, HTN, smoking, hyperlipidaemia (traditional CV risk factors)
  • TIA - "warning strokes" from the same territory; unstable plaque = crescendo TIAs
  • Chest pain/angina (coexistent CAD - atherosclerosis is systemic)
  • Intermittent claudication (PVD - same pathology in legs)
Clinical Pearl #6 - TIA Is a Medical Emergency (Not a Minor Event): After a TIA, the risk of stroke within 2 days is 10-15% (ABCD2 score predicts this). Use the ABCD2 score:
ParameterScore
Age β‰₯601
BP β‰₯140/901
Clinical features: unilateral weakness (2) or speech disturbance alone (1)1-2
Duration β‰₯60 min (2), 10-59 min (1)0-2
Diabetes1
Total0-7
Score β‰₯4 = high risk β†’ admit and work up urgently (carotid duplex + brain MRI within 24h). The reason TIA is dangerous is that the plaque is unstable and the same mechanism that produced the transient deficit is still active.

2. Cardioembolism

Pathophysiology: Thrombus forms in the heart β†’ embolises to a cerebral artery β†’ sudden complete occlusion β†’ large cortical infarct (no time to develop collaterals). Typically causes sudden maximal deficit at onset with cortical features (aphasia, hemianopia, neglect).
History clues:
  • Atrial fibrillation (most common cause - ask for palpitations, irregular pulse, syncope)
  • Rheumatic fever / valvular heart disease (mitral stenosis β†’ LA enlargement β†’ LA thrombus)
  • MI/poor LV function β†’ mural thrombus
  • Infective endocarditis β†’ septic embolism (ask for fever, malaise, embolic phenomena)
Clinical Pearl #7 - Cardioembolism Classically Causes Haemorrhagic Transformation: When a large embolus suddenly occludes an artery, then later fragments and disperses, blood reperfuses into already-infarcted ischaemic tissue. The damaged capillaries, having lost their blood-brain barrier integrity, cannot withstand the pressure - they bleed. This is haemorrhagic transformation and is one reason why anticoagulation timing after cardioembolic stroke must be carefully considered. The "1-3-6-12 rule" is commonly used: small non-disabling stroke β†’ anticoagulate at day 1-3; large disabling stroke β†’ wait 6-12 days.

3. Vasculitis

History clues your faculty lists:
  • Infective vasculitis: HIV, syphilis (ask sexual history, IV drug use, blood transfusions)
  • Autoimmune vasculitis: SLE, antiphospholipid syndrome (joint pain, skin rashes, oral ulcers, hair loss, haematuria - classical SLICC criteria), long-standing low-grade fever
Clinical Pearl #8 - Young Stroke (< 45 years) = Extended Differential: In a young patient with stroke, always systematically consider:
  1. Cardioembolism (patent foramen ovale - paradoxical embolism)
  2. Arterial dissection (carotid or vertebral) - ask for neck trauma, manipulation, or neck pain/Horner's preceding stroke
  3. Antiphospholipid syndrome - recurrent arterial/venous thrombosis, pregnancy losses
  4. Thrombophilia (protein C/S deficiency, Factor V Leiden, antithrombin III deficiency) - family history of young strokes, recurrent DVT/PE
  5. Sickle cell disease, CADASIL, Fabry disease
  6. Vasculitis (infective, autoimmune)
  7. Substance use (cocaine causes vasospasm β†’ stroke; amphetamines β†’ haemorrhagic stroke)

4. Haemorrhagic Stroke

Clinical Pearl #9 - The Clinical Distinction: Ischaemic vs. Haemorrhagic:
Your faculty PDF gives the most important statement: "It is not possible on clinical grounds alone to reliably differentiate between ischaemic stroke and intracranial haemorrhage."
This is absolutely true and cannot be overstated. NCCT (non-contrast CT) is MANDATORY in every stroke patient.
However, these features point towards ICH at the bedside:
FeaturePoints Towards ICHPoints Towards Ischaemia
HeadacheSevere, sudden ("thunderclap")Mild or absent
VomitingProminentUncommon
Level of consciousnessDepressed earlyUsually preserved early
BPMarkedly elevatedVariable
ProgressionMinutes to hoursSudden onset maximal
Location (on CT)Deep (HTN) or lobar (amyloid)Vascular territory
SAH on CTSubarachnoid blood + neck stiffness–
Pathophysiology of ICH: Deep haemorrhages (basal ganglia, thalamus, pons, cerebellum) = Charcot-Bouchard microaneurysm rupture due to hypertensive lipohyalinosis. Lobar haemorrhages = cerebral amyloid angiopathy (Ξ²-amyloid deposits in vessel walls, elderly, normotensive).
Pathophysiology of SAH: 80% = ruptured saccular (berry) aneurysm. Classic presentation: "worst headache of my life" - thunderclap onset - sentinel bleed. Neck stiffness develops over hours (meningism from blood in subarachnoid space). NCCT is ~98% sensitive within 12 hours but falls to ~50% by 1 week β†’ if CT negative and SAH suspected β†’ LP at 12 hours (xanthochromia by spectrophotometry).

STEP 4: EXCLUDING STROKE MIMICS

Your faculty PDF explicitly lists these - and this is a critically important teaching point. You must actively rule out these conditions before giving thrombolysis.
MimicKey Distinguishing FeatureMechanism
Todd's paresisPreceding witnessed seizure + post-ictal state; weakness resolves within hoursCortical exhaustion after seizure
HypoglycaemiaBGL <2.8 mmol/L; ask for insulin/sulphonylurea use; reverses with glucoseNeuroglycopenia β†’ cortical dysfunction
Hypertensive encephalopathyBilateral, gradual, + severe HTN + papilloedemaPosterior reversible encephalopathy
Brain tumourWeeks of headache, morning vomiting; mass effect on CTSpace-occupying lesion
Hemiplegic migrainePreceding aura, throbbing headache, personal/family historyCSD (cortical spreading depression)
CNS infectionFever + altered behaviour before deficit; CSF pleocytosisEncephalitis, cerebral abscess
Metabolic encephalopathyLiver failure (flap, fetor), uraemia, hyponatraemia - BILATERAL deficitsToxin accumulation
Subdural haematomaHistory of fall/trauma (often trivial in elderly); gradual onsetBridging vein rupture
Clinical Pearl #10 - The "Check the Glucose First" Rule: Every patient presenting with a focal neurological deficit must have blood glucose checked within the first 5 minutes at the bedside. Hypoglycaemia (<2.8 mmol/L) perfectly mimics stroke - focal weakness, speech abnormality, hemiplegia. It is the single most important and reversible mimic. Giving IV glucose to a hypoglycaemic patient produces dramatic reversal. Giving tPA to a hypoglycaemic patient causes harm. This is a universal rule - glucose before diagnosis.

STEP 5: COMPLICATIONS TO PROACTIVELY SEEK

Your faculty PDF lists these - and they are causes of preventable deaths after stroke. Your job on the ward is to actively screen for all of them every day.
Medical Complications:
ComplicationMechanismBedside Action
Aspiration pneumonia (most common cause of early death)Dysphagia β†’ silent aspiration β†’ lung infectionWater swallow test before any oral intake. Nil by mouth until assessed by speech therapy
UTIUrinary retention (bladder areflexia), catheter useAvoid catheter if possible; monitor urine output
DVT/PEImmobility, limb paresis, hypercoagulable state post-strokeCompression stockings, LMWH, early mobilization
Pressure soresImmobility + nutritional deficiency2-hourly repositioning, pressure mattress
Epileptic seizuresCortical irritation in acute phaseSeizure precautions; AED if seizure occurs
Clinical Pearl #11 - Dysphagia Is Present in 28-65% of Acute Strokes: (Bradley & Daroff's Neurology) Before feeding ANY stroke patient orally, perform a bedside water swallow test: give 3 teaspoons of water, observe for coughing, wet voice, drooling. Any failure β†’ NG tube + SLT referral. Aspiration pneumonia kills more stroke patients in the first week than the stroke itself.
Neurological Complications:
ComplicationMechanismPeak Timing
Malignant MCA syndromeLarge MCA infarction β†’ massive cytotoxic oedema β†’ transtentorial herniationDay 3-5 (peaks) β†’ resolves by day 14
Haemorrhagic transformationReperfusion of ischaemic blood-brain barrier24-72 hours (especially cardioembolic)
Cerebral vasospasm (SAH)Blood breakdown products β†’ smooth muscle contractionDay 5-14
HydrocephalusIVH or SAH blocking CSF drainageEarly post-haemorrhage
Malignant MCA Syndrome Pearl: CT shows >50% MCA territory involvement + midline shift of septum pellucidum >5mm. Mortality without surgery = 80%. Decompressive hemicraniectomy reduces mortality and improves outcome - offer to eligible patients (age <60 years, within 48h of symptom onset, per DESTINY II trial criteria).

STEP 6: SYSTEMATIC EXAMINATION

Following your faculty PDF's examination framework with pathophysiological reasoning:

General Examination

  • GCS: Baseline + trends. Falling GCS in ischaemic stroke = herniation (malignant oedema) or haemorrhagic transformation - immediate CT.
  • BMI: Obesity = risk factor; also malnutrition predicts poor recovery.
  • Neck stiffness: SAH (meningism from subarachnoid blood). Test gently - positive = chin cannot reach chest. Never test if cervical spine injury suspected.
  • Pallor: Anaemia (cardiac cause of stroke via AF in CCF; also polycythaemia β†’ hyperviscosity β†’ thrombosis).
  • Plethora: Polycythaemia (↑ haematocrit β†’ ↑ blood viscosity β†’ thrombosis β†’ stroke).
  • Xanthelasma / tendon xanthomas / corneal arcus: Hyperlipidaemia β†’ atherosclerotic aetiology.
  • Features of vasculitis: Livedo reticularis (APS), Gottron's papules, nasal septal perforation (GPA), oral ulcers (SLE, Behcet's).
  • Osler's nodes, Janeway lesions, splinter haemorrhages, clubbing: Infective endocarditis β†’ septic emboli.
  • Bed sores: Pressure areas (sacrum, heels, trochanters) - examine on admission as baseline.

Neurological Examination

The goal is to localize the lesion - this is the neurologist's craft.
Motor system: Look for UMN pattern - spastic weakness, hyperreflexia, upgoing plantar (Babinski +ve), pronator drift. Acute stroke initially causes hypotonia and hyporeflexia (diaschisis - temporary depression of function in connected pathways). Spasticity develops over days to weeks.
Clinical Pearl #12 - Pronator Drift: Ask the patient to extend both arms horizontally with palms up, close their eyes, and hold for 10 seconds. A UMN lesion causes the arm to drift downward AND pronate. This is often the first detectable sign of a subtle corticospinal tract lesion. More sensitive than the Babinski in an acute cortical stroke.
Sensory system: Test light touch, pinprick (spinothalamic), vibration and proprioception (dorsal column). Pure sensory stroke (thalamic lacune) = all modalities affected. Cortical sensory loss = graphaesthesia and stereognosis impaired with preserved primary modalities.
Cranial nerves: Specifically:
  • CN II: Visual field defect (hemianopia in MCA/PCA)
  • CN III, IV, VI: Gaze palsy, diplopia (brainstem)
  • CN VII: UMN (forehead spared - bilateral cortical supply to upper face) vs LMN (entire face including forehead)
  • CN XII: Tongue deviates towards the weak side in UMN lesion (ipsilateral corticobulbar fibres cross at medulla)
Higher functions: MMSE/MoCA, language (fluency, comprehension, repetition, naming), visuospatial.

Cardiovascular Examination

Your faculty PDF's key points - with reasoning:
FindingSignificanceMechanism
Pulse irregularityAtrial fibrillation (most common cardioembolic source)Chaotic atrial depolarization β†’ stasis β†’ LA appendage thrombus β†’ embolism
BP both armsSubclavian steal syndrome if >20 mmHg differenceSubclavian artery stenosis β†’ reversed vertebral artery flow
Apex beatDisplaced = LV dilatation (CCF β†’ AF β†’ cardioembolic)
Heart murmurMitral stenosis = most common valvular cause of cardioembolic stroke in youngRheumatic β†’ thickened MV β†’ turbulent flow β†’ LA thrombus
Carotid bruitsIpsilateral ICA stenosis (but absence doesn't exclude stenosis)Turbulence from atheromatous plaque - listen just below angle of jaw
Clinical Pearl #13 - Carotid Bruit Pitfalls: A carotid bruit is heard when ICA stenosis is 40-80%. With >95% stenosis, flow is so reduced that the bruit disappears. So absence of bruit does not exclude critical stenosis. Always do carotid duplex in anterior circulation TIA/stroke regardless of auscultation. Conversely, a carotid bruit can be a transmitted cardiac murmur. Timing and radiation help distinguish.

STEP 7: THE BARTHEL INDEX - Functional Assessment

Your faculty PDF emphasises this as "the most important" functional assessment.
Why the Barthel Index Matters:
The Barthel Index (0-100) assesses 10 activities of daily living. It determines:
  1. Severity of stroke disability
  2. Rehabilitation intensity required
  3. Discharge destination (home vs. nursing home vs. rehabilitation unit)
  4. Social support requirements
Your faculty PDF's full checklist: Bathing Β· Toileting Β· Dressing Β· Personal hygiene Β· Grooming Β· Eating Β· Mobility Β· Transfers Β· Recreational activities Β· Speech and higher function
Clinical Pearl #14 - Social History Is Part of the Clinical Examination: As your faculty PDF states: "This is extremely important in this case." You must know:
  • Who lives with the patient (formal and informal caregivers)?
  • What is the home environment? (Steps? Bathroom access? Bed on ground floor?)
  • What is the family income and support system?
  • Is the nearest rehabilitation facility accessible?
A stroke patient with Barthel = 50 discharged to a 3-storey walk-up flat with no family support has a worse outcome than one with Barthel = 40 who has a ground-floor flat and a dedicated family. Social factors are clinical factors.

STEP 8: INVESTIGATIONS - Logical Sequence

Your faculty PDF + textbook synthesis:

Immediate (First Hour):

InvestigationPurpose
Blood glucose (bedside)Exclude hypoglycaemia BEFORE anything else
FBCPolycythaemia, anaemia, thrombocytopenia
Coagulation (INR/APTT, platelets)Bleeding risk; anticoagulant status for thrombolysis eligibility
U&E, creatinineRenal function; electrolytes
Blood glucose, HbA1cHyperglycaemia worsens outcome (directly toxic to ischaemic neurones)
ECGAF, recent MI (mural thrombus), prolonged QTc
NCCT brainMandatory - exclude haemorrhage (100% sensitive for fresh blood)
Clinical Pearl #15 - The CT in Acute Ischaemic Stroke Is Often Normal: NCCT is normal in the first 6 hours in most ischaemic strokes. A normal CT does NOT mean no stroke. The role of the NCCT in the acute phase is to exclude haemorrhage (hyperdense blood) and exclude stroke mimics (tumour, abscess). Early ischaemic signs on NCCT: hyperdense MCA sign (clot in artery), loss of grey-white differentiation, sulcal effacement, obscuration of the lenticular nucleus.
For thrombolysis decisions (especially extended window 4.5-24h): MRI DWI + perfusion or CT perfusion imaging is used to identify ischaemic penumbra (salvageable tissue).

Subsequent (First 24-48 hours):

InvestigationPurpose
MRI brain (DWI)Gold standard for stroke detection; positive within minutes
Lipid profileDyslipidaemia risk factor
ESR, CRPVasculitis, infective endocarditis, inflammatory cause
LFTsStatin use monitoring; liver disease affects coagulation
Echo (TTE/TOE)Cardioembolic source: LV thrombus, valvular disease, PFO, atrial myxoma
Carotid duplexICA stenosis in anterior circulation stroke
CT/MR angiographyLarge vessel occlusion (for thrombectomy eligibility)
For young stroke:
  • ANA, ANCA, anti-dsDNA, antiphospholipid antibodies (lupus anticoagulant, anti-cardiolipin)
  • Protein C, S, antithrombin III, Factor V Leiden, prothrombin gene mutation
  • Ceruloplasmin (Wilson's), Ξ±-galactosidase (Fabry disease)
  • HIV, VDRL/TPHA (syphilis)
  • Haemoglobin electrophoresis (sickle cell)

STEP 9: MANAGEMENT

ABC + Salvage the Penumbra (Your Faculty PDF's Core Principle)

The penumbra is your therapeutic target. It is ischaemic but alive. The 4 enemies of the penumbra that you must actively prevent are:
EnemyTargetWhy It Harms
HypotensionMaintain BP (permissive HTN in acute phase)CPP = MAP - ICP; falling MAP reduces perfusion to penumbra
HyperglycaemiaTarget glucose 7-10 mmol/L (avoid >10)Glucose β†’ lactate in ischaemic tissue β†’ local acidosis β†’ cell death
PyrexiaTreat fever aggressively (paracetamol, cooling)For every 1Β°C rise β†’ metabolic demand ↑ 10% β†’ accelerates penumbra death
HypoxiaSpO2 >94%O2 delivery to marginal tissue; intubate if needed
Blood Pressure Management (the most nuanced): Your faculty PDF states: "BP often elevated and falls spontaneously within first few days."
  • Acute ischaemic stroke: do NOT lower BP unless >220/120 mmHg (or >185/110 if giving tPA)
  • Rationale: The brain auto-regulation curve shifts rightward after stroke - the injured brain needs higher BP to perfuse the penumbra. Aggressive BP lowering kills the penumbra by dropping perfusion pressure.
  • After 72 hours: gradual introduction of antihypertensives targeting <140/90 long-term

Specific Treatment - Ischaemic Stroke

1. Aspirin 300 mg immediately after haemorrhage excluded on CT
Clinical Pearl #16 - Why Not Start Aspirin Until After CT? If you give aspirin to a patient with ICH, you worsen the haemorrhage by inhibiting platelet plug formation. Haemorrhagic stroke on CT is a hard contraindication to antiplatelet therapy. Every hour saved in giving aspirin to an ischaemic stroke patient prevents approximately 1 further event per 1000 treated - so delay for CT, but do not delay CT.
2. Thrombolysis - IV alteplase (rt-PA)
Your faculty PDF's full criteria:
Indications:
  • Age >18 years
  • Clinical diagnosis of ischaemic stroke with measurable neurological deficit
  • Onset within 4.5 hours (ECASS III trial extended the original 3-hour window)
  • No haemorrhage on CT
Contraindications (absolute):
ContraindicationReasoning
Minor/rapidly resolving symptomsRisk-benefit unfavourable; deficit may resolve spontaneously
Stroke or serious head trauma in last 3 monthsRecently infarcted brain = high haemorrhagic transformation risk
Known history of ICHPrior ICH = underlying vascular abnormality; catastrophic re-bleed risk
SBP >185 or DBP >110 at time of treatmentHaemorrhagic transformation risk; can treat BP first then give tPA
Symptoms of SAHtPA in SAH = catastrophic
GI/GU haemorrhage in last 21 daysSystemic haemorrhage risk
Arterial puncture at non-compressible site in last 7 daysBleeding at puncture site
Heparin within 48 hours + elevated APTTCoagulopathy
Platelets <100,000/ΞΌLCoagulopathy
Clinical Pearl #17 - "Time Is Brain": Every minute of untreated major ischaemic stroke = ~1.9 million neurons die. In an 87-minute delay, brain ages 3.6 years. The numbers: with large vessel occlusion, 120 mL/hour of brain tissue converts from penumbra to infarct. This is the pathophysiological basis of the entire stroke chain of survival. Door-to-needle time target = <60 minutes.
3. Thrombectomy (Endovascular)
Not explicitly in your faculty PDF but essential modern knowledge: Mechanical thrombectomy with stent retriever for large vessel occlusion (ICA, proximal MCA M1) within 6 hours (DAWN and DEFUSE-3 trials extended to 24 hours in selected patients). Dramatically superior to tPA alone for proximal occlusions.

Specific Treatment - Haemorrhagic Stroke (ICH)

Indications for surgical evaluation (your faculty PDF):
  • Cerebellar haemorrhage >3 cm in diameter + deteriorating consciousness + brainstem compression + hydrocephalus β†’ urgent surgical evacuation or EVD
  • Supratentorial lobar clots >30 mL within 1 cm of surface + clinical deterioration β†’ evacuation
Why cerebellar haemorrhage is a special emergency: The posterior fossa has extremely limited volume. A 3 cm bleed causes direct compression of the brainstem (obstructive hydrocephalus from IVth ventricle compression) - patients can herniate rapidly. Unlike supratentorial ICH where medical management may suffice, cerebellar ICH at this size = neurosurgical emergency.
BP management in ICH: Target SBP <140 mmHg (INTERACT2 trial) - reduces haematoma expansion and improves outcome. This is the exact opposite of ischaemic stroke management.

STEP 10: SECONDARY PREVENTION

Once the acute phase is managed, your attention shifts to preventing the next stroke:
AetiologySecondary Prevention
AtherosclerosisAspirin 75-100 mg/day; statin (target LDL <1.8 mmol/L); BP control; DM control; smoking cessation; carotid endarterectomy/stenting if ICA stenosis β‰₯70%
Cardioembolism (AF)Anticoagulation - NOAC preferred (dabigatran, rivaroxaban, apixaban); rate control; discuss with cardiology
Cardioembolism (valve/MS)Warfarin (INR 2-3); valve surgery if indicated
LacunarAggressive BP control (most important); antiplatelet therapy; statin
Thrombophilia/APSLong-term anticoagulation

Clinical Pearls Summary - Ward Round Quick Reference

PearlConcept
"Sudden" onset = vascular until proven otherwiseTemporal profile is your first diagnostic clue
Bilateral weakness β‰  strokeThink metabolic, bilateral, spinal cord
Crossed signs = posterior circulation/brainstemIpsilateral CN deficit + contralateral limb = brainstem lesion
No cortical signs = lacunarAphasia/neglect/hemianopia exclude lacunar
Check glucose FIRST in every focal deficitHypoglycaemia is the most reversible stroke mimic
NCCT normal β‰  no ischaemic strokeCT rules out haemorrhage; MRI DWI detects ischaemia
Permissive HTN in acute ischaemiaDo not lower BP <220/120 without tPA; penumbra needs it
Fever + hyperglycaemia kill the penumbraActively treat both from minute 1
Dysphagia screen before oral intake28-65% of stroke patients; aspiration pneumonia kills
Barthel + social history = clinical examinationDischarge planning begins on admission
tPA window = 4.5 hours (with contraindication check)Bleeding risk outweighs benefit outside this window
Cerebellar haemorrhage >3cm = neurosurgical emergencySmall posterior fossa β†’ rapid brainstem compression
AF in any stroke β†’ start anticoagulationNot antiplatelets - antiplatelet efficacy in AF is insufficient
"Worst headache of life" = SAH until proven otherwiseDo CT, then LP at 12h if CT negative

Sources: Faculty PDF (Stroke vith del.pdf) Β· Fuster & Hurst's The Heart 15E Β· Neuroanatomy through Clinical Cases 3E Β· Bradley & Daroff's Neurology in Clinical Practice

Create a presentation on this stroke approach for ward rounds

Running Command

mkdir -p /home/daytona/workspace/stroke-presentation && ls /home/daytona/workspa…

Writing File

~/stroke-presentation/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Approach to Stroke – Ward Rounds";

// ─── PALETTE ─────────────────────────────────────────────────────────────────
const C = {
  bg:       "0A1628",   // deep navy
  panel:    "132040",   // mid-navy panel
  card:     "0E1A33",   // card bg
  accent1:  "E63946",   // red – emergency / stroke urgency
  accent2:  "2EC4B6",   // teal – process / ischaemia
  accent3:  "F4A261",   // amber – warning / pearl
  accent4:  "A8DADC",   // sky – info / features
  accent5:  "6A994E",   // green – safe / management
  white:    "FFFFFF",
  light:    "C8D8EC",
  muted:    "7B9AB8",
};

// ─── HELPERS ─────────────────────────────────────────────────────────────────
function bg(slide) { slide.background = { color: C.bg }; }

function headerBar(slide, title, sub) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 0.68,
    fill: { color: C.accent1 }, line: { color: C.accent1 }
  });
  slide.addText(title.toUpperCase(), {
    x: 0.28, y: 0, w: 9.4, h: 0.68,
    fontSize: 17, bold: true, color: C.bg, valign: "middle", charSpacing: 2, margin: 0
  });
  if (sub) {
    slide.addText(sub, {
      x: 0.28, y: 0.68, w: 9.4, h: 0.26,
      fontSize: 8.5, italic: true, color: C.muted, valign: "middle", margin: 0
    });
  }
}

function pearl(slide, text, x, y, w, h) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h,
    fill: { color: C.panel }, line: { color: C.accent3, pt: 1.5 }
  });
  slide.addText([
    { text: "β˜… PEARL  ", options: { bold: true, color: C.accent3, fontSize: 8 } },
    { text: text, options: { color: C.light, fontSize: 8 } }
  ], { x: x + 0.1, y, w: w - 0.2, h, valign: "middle", margin: 3 });
}

function badge(slide, text, x, y, w, h, col, fg) {
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w, h,
    fill: { color: col }, line: { color: col }, rectRadius: 0.07
  });
  slide.addText(text, {
    x, y, w, h,
    fontSize: 8, bold: true, color: fg || C.white,
    align: "center", valign: "middle", margin: 0
  });
}

function divLine(slide, x, y, w, col) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x, y, w, h: 0.035,
    fill: { color: col || C.muted }, line: { color: col || C.muted }
  });
}

function numbCircle(slide, n, x, y, r, col) {
  slide.addShape(pres.shapes.OVAL, {
    x, y, w: r, h: r,
    fill: { color: col }, line: { color: col }
  });
  slide.addText(String(n), {
    x, y, w: r, h: r,
    fontSize: 11, bold: true, color: C.bg,
    align: "center", valign: "middle", margin: 0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);

  // Left vertical accent
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.16, h: 5.625,
    fill: { color: C.accent1 }, line: { color: C.accent1 }
  });

  // Decorative arcs
  s.addShape(pres.shapes.OVAL, {
    x: 7.2, y: -1.5, w: 5, h: 5,
    fill: { color: C.panel, transparency: 50 }, line: { color: C.accent1, pt: 1.5 }
  });
  s.addShape(pres.shapes.OVAL, {
    x: 7.8, y: -0.8, w: 3.5, h: 3.5,
    fill: { color: C.accent1, transparency: 82 }, line: { color: C.accent1, pt: 0.5 }
  });

  s.addText("APPROACH TO", {
    x: 0.45, y: 0.85, w: 9, h: 0.55,
    fontSize: 18, color: C.muted, charSpacing: 8, margin: 0
  });
  s.addText("STROKE", {
    x: 0.45, y: 1.32, w: 9, h: 1.6,
    fontSize: 88, bold: true, color: C.accent1, charSpacing: 3, margin: 0
  });
  s.addText("A Systematic Ward Round Framework", {
    x: 0.45, y: 3.0, w: 8, h: 0.42,
    fontSize: 14, color: C.light, italic: true, margin: 0
  });

  divLine(s, 0.45, 3.5, 6, C.accent2);

  s.addText("Faculty PDF  Β·  Fuster & Hurst's The Heart 15E  Β·  Bradley & Daroff's Neurology  Β·  Neuroanatomy through Clinical Cases 3E", {
    x: 0.45, y: 3.62, w: 9.3, h: 0.26,
    fontSize: 8, color: C.muted, margin: 0
  });

  // Bottom row of zone badges
  const zones = [
    { t: "History", c: C.accent2 },
    { t: "Vascular Territory", c: C.accent3 },
    { t: "Aetiology", c: C.accent1 },
    { t: "Mimics", c: C.accent4 },
    { t: "Management", c: C.accent5 },
  ];
  zones.forEach((z, i) => badge(s, z.t, 0.45 + i * 1.88, 4.42, 1.72, 0.46, z.c, C.bg));
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 – DEFINITION + KEY CONCEPTS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Definition & Pathophysiology", "The 'Sudden' rule Β· Penumbra Β· Core");

  // Left – definition cards
  const cards = [
    { lbl: "STROKE DEFINED", text: "Focal (or global) neurological deficit due to a vascular cause lasting >24 hours β€” OR producing permanent deficit/death within 24 hours", col: C.accent1 },
    { lbl: "TRANSIENT ISCHAEMIC ATTACK (TIA)", text: "Same mechanism but deficit resolves completely within 24 h (modern: <1 h with no DWI lesion). NOT benign β€” 10–15% stroke risk within 2 days", col: C.accent3 },
    { lbl: "WHY 'SUDDEN' MATTERS", text: "Stroke produces instantaneous maximal deficit at onset. The brain has no pain receptors in parenchyma β€” you feel the loss of function, not the cell death. Gradual onset = tumour, abscess, SDH", col: C.accent2 },
  ];
  cards.forEach((c, i) => {
    const y = 1.02 + i * 1.45;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 4.55, h: 1.38,
      fill: { color: C.card }, line: { color: c.col, pt: 1.5 } });
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 4.55, h: 0.3,
      fill: { color: c.col }, line: { color: c.col } });
    s.addText(c.lbl, { x: 0.2, y, w: 4.55, h: 0.3,
      fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
    s.addText(c.text, { x: 0.3, y: y + 0.34, w: 4.35, h: 1.0,
      fontSize: 9, color: C.light, margin: 0, wrap: true });
  });

  // Right – Penumbra vs Core diagram (text-based)
  s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 1.02, w: 4.65, h: 0.32,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("ISCHAEMIC PENUMBRA CONCEPT", { x: 5.1, y: 1.02, w: 4.65, h: 0.32,
    fontSize: 9, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  // Core circle
  s.addShape(pres.shapes.OVAL, { x: 6.2, y: 1.48, w: 2.4, h: 2.4,
    fill: { color: C.accent1, transparency: 15 }, line: { color: C.accent1, pt: 2 } });
  s.addShape(pres.shapes.OVAL, { x: 5.8, y: 1.28, w: 3.2, h: 3.2,
    fill: { color: C.accent3, transparency: 60 }, line: { color: C.accent3, pt: 1.5 } });

  s.addText("CORE", { x: 6.85, y: 2.28, w: 1.1, h: 0.35,
    fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
  s.addText("CBF <10 mL/100g/min\nIrreversible death\nwithin minutes", { x: 6.25, y: 2.65, w: 2.3, h: 0.58,
    fontSize: 7.5, color: C.light, align: "center", margin: 0 });

  s.addText("PENUMBRA", { x: 5.88, y: 1.42, w: 1.5, h: 0.28,
    fontSize: 9, bold: true, color: C.accent3, margin: 0 });
  s.addText("CBF 10–20 mL/100g/min\nDysfunctional but ALIVE\nSALVAGEABLE with\nreperfusion therapy", { x: 5.2, y: 1.72, w: 1.7, h: 0.7,
    fontSize: 7.5, color: C.light, margin: 0 });

  // CBF threshold legend
  s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 4.65, w: 4.65, h: 0.65,
    fill: { color: C.panel }, line: { color: C.accent2, pt: 1 } });
  s.addText([
    { text: "Normal CBF: ", options: { bold: true, color: C.accent2 } },
    { text: "50 mL/100g/min  ", options: { color: C.light } },
    { text: "Penumbra: ", options: { bold: true, color: C.accent3 } },
    { text: "10–20  ", options: { color: C.light } },
    { text: "Core death: ", options: { bold: true, color: C.accent1 } },
    { text: "<10\n", options: { color: C.light } },
    { text: "Every minute of untreated major stroke = ~1.9 million neurons die β†’ 3.6 years of brain ageing", options: { bold: false, color: C.muted, fontSize: 7.5 } }
  ], { x: 5.2, y: 4.67, w: 4.45, h: 0.61, fontSize: 8.5, margin: 0, wrap: true });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 – HISTORY-TAKING
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "History-Taking", "Presenting complaint Β· Symptom analysis Β· Aetiology Β· Complications");

  // Opening case
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 0.98, w: 9.6, h: 0.52,
    fill: { color: C.panel }, line: { color: C.accent2, pt: 1 } });
  s.addText([
    { text: "OPENING CASE:  ", options: { bold: true, color: C.accent2 } },
    { text: "Mr. X, 65 y/o, known HTN + DM, presented with ", options: { color: C.light } },
    { text: "sudden onset left-sided face + arm + leg weakness", options: { bold: true, color: C.accent3 } },
    { text: " for 2 hours", options: { color: C.light } }
  ], { x: 0.3, y: 0.98, w: 9.4, h: 0.52, fontSize: 9.5, valign: "middle", margin: 0 });

  // Col 1 - PC + Symptom Analysis
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.58, w: 3.05, h: 0.3,
    fill: { color: C.accent2 }, line: { color: C.accent2 } });
  s.addText("PRESENTING COMPLAINT", { x: 0.2, y: 1.58, w: 3.05, h: 0.3,
    fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const pc = [
    "Sudden onset face, arm, leg weakness",
    "Altered consciousness",
    "Facial weakness / double vision / numbness",
    "Difficulty talking / dysphagia / nasal regurg",
    "Loss of balance / ataxia (cerebellar)",
  ];
  pc.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.9 + i * 0.33, w: 3.05, h: 0.31,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addText("Β· " + t, { x: 0.3, y: 1.9 + i * 0.33, w: 2.9, h: 0.31,
      fontSize: 8, color: C.light, valign: "middle", margin: 0 });
  });

  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 3.58, w: 3.05, h: 0.28,
    fill: { color: C.accent3 }, line: { color: C.accent3 } });
  s.addText("SYMPTOM ANALYSIS (5 Questions)", { x: 0.2, y: 3.58, w: 3.05, h: 0.28,
    fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
  const sq = ["What was patient doing at onset?", "Type: Face / Arm / Leg / Speech", "Loss of consciousness?", "UL vs LL predominant?", "Progression: resolved / static / worsening?"];
  sq.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 3.88 + i * 0.31, w: 3.05, h: 0.29,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addText((i+1)+". " + t, { x: 0.3, y: 3.88 + i * 0.31, w: 2.9, h: 0.29,
      fontSize: 8, color: C.light, valign: "middle", margin: 0 });
  });

  // Col 2 - Aetiology history
  s.addShape(pres.shapes.RECTANGLE, { x: 3.45, y: 1.58, w: 3.25, h: 0.3,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("AETIOLOGY HISTORY", { x: 3.45, y: 1.58, w: 3.25, h: 0.3,
    fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const aetiRows = [
    { cause: "Atherosclerosis", ask: "DM, HTN, smoking, dyslipidaemia\nAngina, claudication, past TIA", col: C.accent3 },
    { cause: "Cardioembolism", ask: "Palpitations/AF, rheumatic fever\nMI, valvular disease, endocarditis", col: C.accent1 },
    { cause: "Vasculitis", ask: "SLE (joint pain, rash, oral ulcers)\nHIV, syphilis (IV drugs, sexual hx)", col: C.accent4 },
    { cause: "Thrombophilia", ask: "FHx young stroke\nRecurrent pregnancy losses, DVT/PE", col: C.accent2 },
    { cause: "Haemorrhagic", ask: "Anticoagulant use\nSevere HTN, cocaine/amphetamines", col: C.accent1 },
  ];
  aetiRows.forEach((r, i) => {
    const y = 1.93 + i * 0.62;
    s.addShape(pres.shapes.RECTANGLE, { x: 3.45, y, w: 3.25, h: 0.6,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.RECTANGLE, { x: 3.45, y, w: 0.07, h: 0.6,
      fill: { color: r.col }, line: { color: r.col } });
    s.addText(r.cause, { x: 3.56, y: y+0.03, w: 1.1, h: 0.25,
      fontSize: 8, bold: true, color: r.col, margin: 0 });
    s.addText(r.ask, { x: 3.56, y: y+0.28, w: 3.06, h: 0.3,
      fontSize: 7.5, color: C.muted, margin: 0 });
  });

  // Col 3 - Mimics + complications
  s.addShape(pres.shapes.RECTANGLE, { x: 6.88, y: 1.58, w: 2.9, h: 0.3,
    fill: { color: C.accent4 }, line: { color: C.accent4 } });
  s.addText("EXCLUDE STROKE MIMICS", { x: 6.88, y: 1.58, w: 2.9, h: 0.3,
    fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const mimics = [
    ["Todd's paresis", "Preceding seizure β†’ post-ictal weakness"],
    ["Hypoglycaemia", "BGL <2.8 mmol/L β†’ check FIRST"],
    ["Brain tumour", "Morning headache + vomiting (weeks)"],
    ["Hemiplegic migraine", "Aura + throbbing HA, FHx"],
    ["CNS infection", "Fever + altered behaviour before deficit"],
    ["Metabolic", "Bilateral; liver/renal disease; Na+ abnormal"],
    ["Subdural haematoma", "Trauma hx (trivial in elderly); gradual"],
  ];
  mimics.forEach((m, i) => {
    const y = 1.93 + i * 0.42;
    s.addShape(pres.shapes.RECTANGLE, { x: 6.88, y, w: 2.9, h: 0.4,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addText(m[0], { x: 6.96, y: y+0.02, w: 2.76, h: 0.18,
      fontSize: 8, bold: true, color: C.accent4, margin: 0 });
    s.addText(m[1], { x: 6.96, y: y+0.2, w: 2.76, h: 0.18,
      fontSize: 7.5, color: C.muted, margin: 0 });
  });

  pearl(s, "CHECK GLUCOSE FIRST in every focal deficit β€” hypoglycaemia is the most reversible stroke mimic. Glucose before diagnosis, always.",
    0.2, 5.2, 9.6, 0.28);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 – VASCULAR TERRITORY IDENTIFICATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Vascular Territory Identification", "Anterior Β· Posterior Β· Lacunar Circulation");

  const territories = [
    {
      name: "ANTERIOR CIRCULATION",
      sub: "ICA β†’ MCA / ACA",
      col: C.accent2,
      features: [
        "Contralateral face + arm + leg weakness",
        "Higher cortical dysfunction:",
        "  Β· Aphasia (dominant hemisphere)",
        "  Β· Neglect, anosognosia (non-dominant)",
        "  Β· Hemianopia (homonymous)",
        "  Β· Memory loss, calculation errors",
        "Arm > leg weakness = MCA territory",
        "Leg > arm weakness = ACA territory",
      ],
      pearl: "Aphasia = dominant hemisphere (L in >95% right-handers). Screen with: fluency, comprehension, repetition.",
    },
    {
      name: "POSTERIOR CIRCULATION",
      sub: "Vertebrobasilar β†’ PICA/AICA/SCA/PCA",
      col: C.accent3,
      features: [
        "D-V-F Triad:",
        "  Β· Diplopia (CN III/IV/VI nuclei)",
        "  Β· Vertigo (vestibular nuclei)",
        "  Β· Facial numbness + weakness",
        "Dysphagia + nasal regurgitation (CN IX/X)",
        "Dysarthria (slurring of speech)",
        "Imbalance / truncal ataxia",
        "Crossed signs = PATHOGNOMONIC",
      ],
      pearl: "CROSSED SIGNS = brainstem: ipsilateral CN deficit + contralateral limb findings. Unique to brainstem anatomy.",
    },
    {
      name: "LACUNAR CIRCULATION",
      sub: "Deep penetrating arteries (lenticulostriate, thalamoperforators)",
      col: C.accent1,
      features: [
        "No cortical signs (no aphasia, neglect, hemianopia)",
        "Classic syndromes:",
        "  Β· Pure Motor Hemiparesis (internal capsule/pons)",
        "  Β· Pure Sensory Stroke (thalamus VPL+VPM)",
        "  Β· Ataxic Hemiparesis",
        "  Β· Dysarthria-Clumsy Hand",
        "  Β· Sensorimotor Stroke",
        "Infarct ≀2 cm on DWI / ≀1.5 cm on CT",
      ],
      pearl: "Any cortical sign (aphasia, neglect, hemianopia) EXCLUDES lacunar – re-examine your localisation.",
    },
  ];

  territories.forEach((t, i) => {
    const x = 0.2 + i * 3.27;
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.02, w: 3.1, h: 4.35,
      fill: { color: C.card }, line: { color: t.col, pt: 2 } });
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.02, w: 3.1, h: 0.4,
      fill: { color: t.col }, line: { color: t.col } });
    s.addText(t.name, { x, y: 1.02, w: 3.1, h: 0.4,
      fontSize: 9.5, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
    s.addText(t.sub, { x: x+0.1, y: 1.44, w: 2.9, h: 0.3,
      fontSize: 8, italic: true, color: t.col, margin: 0 });

    divLine(s, x+0.1, 1.76, 2.9, t.col);

    t.features.forEach((f, fi) => {
      s.addText(f, { x: x+0.1, y: 1.82 + fi * 0.3, w: 2.9, h: 0.28,
        fontSize: 8, color: f.startsWith("  Β·") ? C.muted : (f.includes(":") ? C.light : C.light),
        bold: f.includes(":") && !f.startsWith("  "),
        margin: 0 });
    });

    // Pearl at bottom of each card
    s.addShape(pres.shapes.RECTANGLE, { x: x+0.08, y: 4.68, w: 2.95, h: 0.62,
      fill: { color: C.panel }, line: { color: C.accent3, pt: 1 } });
    s.addText("β˜… " + t.pearl, { x: x+0.15, y: 4.7, w: 2.8, h: 0.58,
      fontSize: 7.5, color: C.light, margin: 0, wrap: true });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 – LACUNAR SYNDROMES TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Lacunar Stroke Syndromes", "Neuroanatomy through Clinical Cases 3E Β· Fuster & Hurst 15E");

  // Table
  const hdr = ["SYNDROME", "CLINICAL FEATURES", "LOCATION", "ARTERY"];
  const hdrW = [2.2, 2.85, 2.5, 2.1];
  const hdrX = [0.2, 2.42, 5.28, 7.8];

  hdr.forEach((h, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: hdrX[i], y: 1.02, w: hdrW[i], h: 0.38,
      fill: { color: C.accent1 }, line: { color: C.accent1 } });
    s.addText(h, { x: hdrX[i], y: 1.02, w: hdrW[i], h: 0.38,
      fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
  });

  const rows = [
    ["Pure Motor Hemiparesis", "Face + arm + leg UMN weakness\nNo sensory loss, no cortical signs", "Post. limb internal capsule\nVentral pons\nCorona radiata", "Lenticulostriate\nPontine perforators"],
    ["Pure Sensory Stroke\n(Thalamic lacune)", "All modality sensory loss:\nContralateral face + body", "Thalamus VPL + VPM nuclei", "Thalamoperforators (PCA branch)"],
    ["Ataxic Hemiparesis", "Ipsilateral weakness\n+ ipsilateral limb ataxia", "Pons / internal capsule /\ncorona radiata", "Pontine perforators\nLenticulostriate"],
    ["Dysarthria-Clumsy Hand", "Dysarthria +\ncontralateral hand clumsiness", "Pons / internal capsule", "Pontine perforators"],
    ["Sensorimotor Stroke\n(Thalamocapsular)", "Combined thalamic + motor\nhemiparesis features", "Post. limb IC +\nthalamic VPL/VPM", "Thalamoperforators\n+ lenticulostriate"],
    ["Basal Ganglia Lacune", "Often asymptomatic\nMay β†’ hemiballismus", "Caudate, putamen,\nglobus pallidus, STN", "Lenticulostriate\nAnterior choroidal"],
  ];

  rows.forEach((row, ri) => {
    const y = 1.44 + ri * 0.62;
    const bg2 = ri % 2 === 0 ? C.panel : C.card;
    hdrX.forEach((cx, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: cx, y, w: hdrW[ci], h: 0.6,
        fill: { color: bg2 }, line: { color: bg2 } });
      s.addText(row[ci], { x: cx + 0.06, y, w: hdrW[ci] - 0.12, h: 0.6,
        fontSize: ci === 0 ? 8.5 : 8, bold: ci === 0,
        color: ci === 0 ? C.light : C.muted, valign: "middle", margin: 0, wrap: true });
    });
  });

  pearl(s, "All lacunar strokes share one key feature: ABSENT cortical signs. Presence of aphasia, neglect, or hemianopia means the lesion is NOT lacunar β€” it is cortical or involves white matter projection fibres.",
    0.2, 5.24, 9.6, 0.27);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 – AETIOLOGY (TOAST CLASSIFICATION)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Aetiology β€” TOAST Classification", "Fuster & Hurst 15E Β· Faculty PDF framework");

  const types = [
    {
      title: "LARGE ARTERY\nATHEROSCLEROSIS",
      col: C.accent3,
      patho: "Plaque rupture β†’ in-situ thrombosis OR artery-to-artery embolism from carotid/vertebral",
      clues: ["DM, HTN, smoking, dyslipidaemia", "Angina / intermittent claudication", "Past TIA in same territory", "Carotid bruit on exam"],
      prev: "Antiplatelet + statin + BP control\nCarotid endarterectomy if ICA β‰₯70%",
    },
    {
      title: "CARDIOEMBOLISM",
      col: C.accent1,
      patho: "Thrombus from heart β†’ sudden complete occlusion β†’ large cortical infarct (no time for collaterals to develop)",
      clues: ["AF (most common β€” >40% in >60yr)", "Rheumatic MS β†’ LA thrombus", "Recent MI β†’ mural thrombus", "Infective endocarditis β†’ septic emboli"],
      prev: "Anticoagulation (NOAC for AF)\nWARFARIN for mechanical valves",
    },
    {
      title: "LACUNAR / SMALL\nARTERY OCCLUSION",
      col: C.accent2,
      patho: "Lipohyalinosis + microaneurysm (Charcot-Bouchard) in penetrating arteries from chronic HTN/DM",
      clues: ["Classic lacunar syndrome", "No cortical signs", "Lesion ≀2cm on DWI", "Same vessels rupture β†’ deep ICH"],
      prev: "Aggressive BP control (PRIMARY)\nAntiplatelet + statin",
    },
    {
      title: "VASCULITIS /\nOTHER CAUSES",
      col: C.accent4,
      patho: "Vessel wall inflammation β†’ stenosis/thrombosis. Young patients. Always screen in stroke <45 years",
      clues: ["SLE: joint pain, rash, oral ulcers", "HIV/syphilis: sexual/IV drug hx", "Dissection: neck pain/trauma", "APS: recurrent thrombosis/fetal loss"],
      prev: "Treat underlying cause\nAntiphospholipid β†’ anticoagulation",
    },
  ];

  types.forEach((t, i) => {
    const x = 0.2 + (i % 2) * 4.88;
    const y = i < 2 ? 1.02 : 3.3;
    const w = 4.62; const h = 2.1;

    s.addShape(pres.shapes.RECTANGLE, { x, y, w, h,
      fill: { color: C.card }, line: { color: t.col, pt: 1.5 } });
    s.addShape(pres.shapes.RECTANGLE, { x, y, w, h: 0.38,
      fill: { color: t.col }, line: { color: t.col } });
    s.addText(t.title, { x, y, w, h: 0.38,
      fontSize: 9.5, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

    s.addText("Pathophysiology:", { x: x+0.1, y: y+0.42, w: w-0.2, h: 0.2,
      fontSize: 7.5, bold: true, color: t.col, margin: 0 });
    s.addText(t.patho, { x: x+0.1, y: y+0.62, w: w-0.2, h: 0.42,
      fontSize: 8, color: C.light, margin: 0, wrap: true });

    divLine(s, x+0.1, y+1.06, w-0.2, t.col);

    s.addText("Key history clues:", { x: x+0.1, y: y+1.12, w: w-0.2, h: 0.2,
      fontSize: 7.5, bold: true, color: t.col, margin: 0 });
    t.clues.forEach((c, ci) => {
      s.addText("Β· " + c, { x: x+0.1, y: y+1.32 + ci*0.17, w: w*0.55, h: 0.17,
        fontSize: 7.5, color: C.muted, margin: 0 });
    });

    s.addText("Prevention:", { x: x + w*0.57, y: y+1.12, w: w*0.4, h: 0.2,
      fontSize: 7.5, bold: true, color: C.accent5, margin: 0 });
    s.addText(t.prev, { x: x + w*0.57, y: y+1.32, w: w*0.4, h: 0.62,
      fontSize: 7.5, color: C.muted, margin: 0, wrap: true });
  });

  pearl(s, "Haemorrhagic transformation is hallmark of CARDIOEMBOLISM: embolus fragments β†’ reperfusion into ischaemic BBB-damaged tissue β†’ bleeding. Reason anticoagulation timing must be carefully considered (1-3-6-12 day rule).",
    0.2, 5.46, 9.6, 0.0);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 5.2, w: 9.6, h: 0.34,
    fill: { color: C.panel }, line: { color: C.accent3, pt: 1.5 } });
  s.addText([
    { text: "β˜… PEARL  ", options: { bold: true, color: C.accent3, fontSize: 8 } },
    { text: "Haemorrhagic transformation is hallmark of CARDIOEMBOLISM: large embolus occludes then fragments β†’ reperfusion into ischaemic BBB-damaged tissue β†’ petechial/confluent haemorrhage. Anticoagulation timing: small non-disabling stroke β†’ day 1–3; large disabling β†’ wait 6–12 days.", options: { color: C.light, fontSize: 8 } }
  ], { x: 0.3, y: 5.2, w: 9.4, h: 0.34, valign: "middle", margin: 3 });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 – PHYSICAL EXAMINATION
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Physical Examination", "General Β· Neurological Β· Cardiovascular Β· Functional");

  // Col 1 – General exam
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.02, w: 2.35, h: 0.3,
    fill: { color: C.accent2 }, line: { color: C.accent2 } });
  s.addText("GENERAL EXAM", { x: 0.2, y: 1.02, w: 2.35, h: 0.3,
    fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const gen = [
    ["GCS", "Baseline + trend; falling GCS in ischaemia = herniation/HT"],
    ["Neck stiffness", "SAH (meningism); test gently"],
    ["Plethora", "Polycythaemia β†’ ↑ viscosity β†’ thrombosis"],
    ["Pallor", "Anaemia; consider cardiac cause"],
    ["Xanthelasma/arcus", "Hyperlipidaemia β†’ atherosclerosis"],
    ["Osler's nodes/splinters", "Infective endocarditis β†’ septic emboli"],
    ["Livedo reticularis", "Antiphospholipid syndrome"],
    ["Rash + oral ulcers", "SLE / vasculitis aetiology"],
    ["Bed sores", "Examine on admission as baseline"],
  ];
  gen.forEach((r, i) => {
    const y = 1.35 + i * 0.44;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 2.35, h: 0.42,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addText(r[0], { x: 0.28, y: y+0.01, w: 2.2, h: 0.19,
      fontSize: 8, bold: true, color: C.accent2, margin: 0 });
    s.addText(r[1], { x: 0.28, y: y+0.21, w: 2.2, h: 0.19,
      fontSize: 7.5, color: C.muted, margin: 0 });
  });

  // Col 2 – Neurological exam
  s.addShape(pres.shapes.RECTANGLE, { x: 2.75, y: 1.02, w: 2.95, h: 0.3,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("NEUROLOGICAL EXAM", { x: 2.75, y: 1.02, w: 2.95, h: 0.3,
    fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const neuro = [
    { item: "Motor", detail: "Spastic weakness, hyperreflexia, Babinski +ve\nAcute stroke: initially hypotonic (diaschisis)" },
    { item: "Pronator Drift", detail: "Arms extended palms up, eyes closed β†’\naffected arm drifts DOWN + PRONATES (early UMN sign)" },
    { item: "Cranial Nerves", detail: "CN VII: UMN = forehead spared\nCN XII: tongue deviates towards lesion" },
    { item: "Hemianopia", detail: "Test each visual field quadrant\nMCA/PCA involvement; patient unaware (neglect)" },
    { item: "Sensory", detail: "Pure sensory: all modalities (thalamic lacune)\nCortical: graphaesthesia + stereognosis impaired" },
    { item: "Higher Functions", detail: "MMSE/MoCA, aphasia screen:\nFluency / Comprehension / Repetition / Naming" },
    { item: "Cerebellar", detail: "Finger-nose, heel-shin, dysdiadochokinesia\nGait and tandem walking" },
  ];
  neuro.forEach((r, i) => {
    const y = 1.35 + i * 0.59;
    s.addShape(pres.shapes.RECTANGLE, { x: 2.75, y, w: 2.95, h: 0.57,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addText(r.item, { x: 2.83, y: y+0.03, w: 2.79, h: 0.22,
      fontSize: 8.5, bold: true, color: C.light, margin: 0 });
    s.addText(r.detail, { x: 2.83, y: y+0.26, w: 2.79, h: 0.3,
      fontSize: 7.5, color: C.muted, margin: 0, wrap: true });
  });

  // Col 3 – CVS exam + functional
  s.addShape(pres.shapes.RECTANGLE, { x: 5.9, y: 1.02, w: 3.9, h: 0.3,
    fill: { color: C.accent3 }, line: { color: C.accent3 } });
  s.addText("CARDIOVASCULAR + FUNCTIONAL", { x: 5.9, y: 1.02, w: 3.9, h: 0.3,
    fontSize: 8, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const cvs = [
    ["Pulse", "Irregularly irregular β†’ AF (cardioembolic)\nBP both arms (>20 mmHg diff = subclavian steal)"],
    ["Apex beat", "Displaced = LV dilation β†’ CCF β†’ AF β†’ embolism"],
    ["Heart murmurs", "Mitral stenosis = most common valvular cause\nin young patients (rheumatic fever)"],
    ["Carotid bruits", "ICA stenosis 40-80% (bruit disappears >95%)\nAlways do duplex regardless of auscultation"],
    ["Lung exam", "Aspiration pneumonia (most common\ncause of early death after stroke)"],
  ];
  cvs.forEach((r, i) => {
    const y = 1.35 + i * 0.6;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.9, y, w: 3.9, h: 0.58,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addText(r[0], { x: 5.98, y: y+0.03, w: 3.74, h: 0.22,
      fontSize: 8.5, bold: true, color: C.accent3, margin: 0 });
    s.addText(r[1], { x: 5.98, y: y+0.27, w: 3.74, h: 0.3,
      fontSize: 7.5, color: C.muted, margin: 0, wrap: true });
  });

  pearl(s, "PRONATOR DRIFT: arms extended horizontally palms up, eyes closed 10s β†’ affected arm drifts DOWN + PRONATES. More sensitive than Babinski for subtle corticospinal lesions.",
    0.2, 5.18, 9.6, 0.3);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 – INVESTIGATIONS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Investigations", "Immediate Β· Second-line Β· Imaging Β· Young stroke screen");

  // IMMEDIATE panel
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.02, w: 4.65, h: 0.3,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("IMMEDIATE (First Hour) β€” EVERY PATIENT", { x: 0.2, y: 1.02, w: 4.65, h: 0.3,
    fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const imm = [
    ["Blood glucose (BEDSIDE)", "Exclude hypoglycaemia BEFORE anything else", C.accent3],
    ["FBC", "Polycythaemia, anaemia, thrombocytopenia, infection", C.accent2],
    ["Coagulation: INR, APTT, platelets", "Bleeding risk; anticoagulant status for tPA eligibility", C.accent2],
    ["U&E, creatinine", "Renal function; Na+ (SIADH in SAH)", C.accent2],
    ["Blood glucose + HbA1c", "Hyperglycaemia = directly toxic to ischaemic neurones", C.accent3],
    ["ECG", "AF, recent MI (mural thrombus), prolonged QTc", C.accent1],
    ["NCCT Brain (MANDATORY)", "100% sensitive for haemorrhage. Often NORMAL in early ischaemia β€” does NOT exclude stroke", C.accent1],
  ];
  imm.forEach((r, i) => {
    const y = 1.35 + i * 0.42;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 4.65, h: 0.4,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.OVAL, { x: 0.26, y: y+0.11, w: 0.18, h: 0.18,
      fill: { color: r[2] }, line: { color: r[2] } });
    s.addText(r[0], { x: 0.52, y: y+0.01, w: 4.28, h: 0.19,
      fontSize: 8, bold: true, color: C.light, margin: 0 });
    s.addText(r[1], { x: 0.52, y: y+0.2, w: 4.28, h: 0.18,
      fontSize: 7.5, color: C.muted, margin: 0 });
  });

  // SECOND LINE + IMAGING
  s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 1.02, w: 4.7, h: 0.3,
    fill: { color: C.accent2 }, line: { color: C.accent2 } });
  s.addText("SUBSEQUENT + YOUNG STROKE SCREEN", { x: 5.1, y: 1.02, w: 4.7, h: 0.3,
    fontSize: 9, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const sub = [
    ["MRI Brain (DWI)", "Gold standard: positive within minutes; penumbra mapping", C.accent2],
    ["Lipid profile + LFTs", "Dyslipidaemia; statin monitoring", C.accent2],
    ["ESR + CRP", "Vasculitis, infective endocarditis", C.accent4],
    ["Echo (TTE/TOE)", "LV thrombus, MS, valvular disease, PFO", C.accent1],
    ["Carotid duplex", "ICA stenosis in anterior circulation stroke", C.accent3],
    ["CT/MR Angiography", "Large vessel occlusion for thrombectomy", C.accent3],
    ["ANA, ANCA, APS screen", "Young stroke β€” vasculitis/thrombophilia", C.accent4],
    ["HIV, VDRL/TPHA", "Young stroke β€” infective vasculitis", C.accent4],
    ["Protein C/S, AT-III, Factor V Leiden", "Thrombophilia screen in young patients", C.accent4],
    ["Haemoglobin electrophoresis", "Sickle cell disease in young/ethnic patients", C.accent4],
  ];
  sub.forEach((r, i) => {
    const y = 1.35 + i * 0.38;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y, w: 4.7, h: 0.36,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.OVAL, { x: 5.16, y: y+0.09, w: 0.18, h: 0.18,
      fill: { color: r[2] }, line: { color: r[2] } });
    s.addText(r[0], { x: 5.42, y: y+0.01, w: 4.3, h: 0.18,
      fontSize: 8, bold: true, color: C.light, margin: 0 });
    s.addText(r[1], { x: 5.42, y: y+0.19, w: 4.3, h: 0.16,
      fontSize: 7, color: C.muted, margin: 0 });
  });

  pearl(s, "NCCT normal β‰  no stroke. CT excludes haemorrhage and mimics (tumour/abscess). Ischaemia is invisible on CT for 6-24h. MRI DWI detects ischaemia within MINUTES of onset.",
    0.2, 5.2, 9.6, 0.3);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 – ACUTE MANAGEMENT
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Acute Management", "Salvage the penumbra Β· Faculty PDF protocol");

  // 4 ENEMIES OF THE PENUMBRA
  s.addText("THE 4 ENEMIES OF THE PENUMBRA β€” ACT ON ALL FROM MINUTE 1", {
    x: 0.2, y: 1.0, w: 9.6, h: 0.28,
    fontSize: 9, bold: true, color: C.accent3, margin: 0
  });

  const enemies = [
    { e: "HYPOTENSION", t: "Maintain BP: permissive HTN in acute phase\n>220/120 mmHg β†’ careful lowering\nAfter 72h β†’ gradual antihypertensives", c: C.accent1 },
    { e: "HYPERGLYCAEMIA", t: "Target glucose 7–10 mmol/L\nGlucose β†’ lactate in ischaemic tissue β†’ local acidosis β†’ accelerates cell death", c: C.accent3 },
    { e: "PYREXIA", t: "1Β°C rise = 10% ↑ metabolic demand\nTreat fever aggressively: paracetamol, cooling\nCommon source: aspiration pneumonia", c: C.accent1 },
    { e: "HYPOXIA", t: "Target SpO2 >94%\nO2 delivery to marginal tissue is critical\nIntubate if needed for airway protection", c: C.accent2 },
  ];
  enemies.forEach((e, i) => {
    const x = 0.2 + i * 2.42;
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.32, w: 2.28, h: 1.62,
      fill: { color: C.card }, line: { color: e.c, pt: 2 } });
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.32, w: 2.28, h: 0.32,
      fill: { color: e.c }, line: { color: e.c } });
    s.addText(e.e, { x, y: 1.32, w: 2.28, h: 0.32,
      fontSize: 9, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
    s.addText(e.t, { x: x+0.1, y: 1.67, w: 2.1, h: 1.25,
      fontSize: 8, color: C.light, margin: 0, wrap: true });
  });

  divLine(s, 0.2, 3.02, 9.6, C.accent1);

  // Ischaemic specific treatment
  s.addText("SPECIFIC TREATMENT β€” ISCHAEMIC STROKE", {
    x: 0.2, y: 3.1, w: 4.7, h: 0.28,
    fontSize: 9, bold: true, color: C.accent2, margin: 0
  });

  const isc = [
    { n: "1", t: "ASPIRIN 300 mg IMMEDIATELY after haemorrhage excluded on NCCT", col: C.accent2 },
    { n: "2", t: "IV ALTEPLASE (rt-PA): within 4.5 hours of onset, if no contraindications (see next slide)", col: C.accent3 },
    { n: "3", t: "PERMISSIVE HTN: do NOT lower BP unless >220/120 (or >185/110 for tPA). Brain autoreg shifted right β€” penumbra needs the pressure", col: C.accent3 },
    { n: "4", t: "THROMBECTOMY: large vessel occlusion (ICA, M1 MCA) within 6h (up to 24h in selected patients β€” DAWN/DEFUSE-3)", col: C.accent5 },
    { n: "5", t: "MALIGNANT MCA SYNDROME: >2/3 MCA territory + midline shift >5mm β†’ decompressive HEMICRANIECTOMY (peaks day 3–5)", col: C.accent1 },
  ];
  isc.forEach((r, i) => {
    numbCircle(s, r.n, 0.2, 3.42 + i * 0.4, 0.32, r.col);
    s.addText(r.t, { x: 0.58, y: 3.42 + i * 0.4, w: 4.4, h: 0.38,
      fontSize: 8, color: C.light, valign: "middle", margin: 0, wrap: true });
  });

  // ICH treatment
  s.addText("SPECIFIC TREATMENT β€” HAEMORRHAGIC STROKE (ICH)", {
    x: 5.1, y: 3.1, w: 4.7, h: 0.28,
    fontSize: 9, bold: true, color: C.accent1, margin: 0
  });

  const ich = [
    { n: "1", t: "BP TARGET: SBP <140 mmHg (INTERACT2 trial) β€” OPPOSITE to ischaemic. Reduces haematoma expansion", col: C.accent1 },
    { n: "2", t: "CEREBELLAR HAEMORRHAGE >3 cm + deteriorating + brainstem compression β†’ URGENT surgical evacuation or EVD", col: C.accent3 },
    { n: "3", t: "SUPRATENTORIAL lobar clot >30 mL within 1 cm of surface + clinical deterioration β†’ surgical evacuation", col: C.accent3 },
    { n: "4", t: "REVERSE anticoagulation immediately: Vit K + PCC for warfarin; idarucizumab for dabigatran; andexanet for Xa inhibitors", col: C.accent2 },
    { n: "5", t: "SAH: Nimodipine (prevents vasospasm), EVD if hydrocephalus, coil/clip aneurysm urgently", col: C.accent4 },
  ];
  ich.forEach((r, i) => {
    numbCircle(s, r.n, 5.1, 3.42 + i * 0.4, 0.32, r.col);
    s.addText(r.t, { x: 5.48, y: 3.42 + i * 0.4, w: 4.3, h: 0.38,
      fontSize: 8, color: C.light, valign: "middle", margin: 0, wrap: true });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 – tPA CRITERIA
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Thrombolysis β€” IV Alteplase (rt-PA)", "Faculty PDF criteria Β· 4.5-hour window (ECASS III)");

  // Indications
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.02, w: 4.5, h: 0.35,
    fill: { color: C.accent5 }, line: { color: C.accent5 } });
  s.addText("INDICATIONS", { x: 0.2, y: 1.02, w: 4.5, h: 0.35,
    fontSize: 11, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const indic = [
    "Age > 18 years",
    "Clinical diagnosis of ischaemic stroke",
    "Measurable neurological deficit present",
    "Onset of symptoms within 4.5 hours",
    "No haemorrhage on CT brain",
  ];
  indic.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.4 + i * 0.48, w: 4.5, h: 0.46,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.OVAL, { x: 0.28, y: 1.54 + i*0.48, w: 0.2, h: 0.2,
      fill: { color: C.accent5 }, line: { color: C.accent5 } });
    s.addText("βœ“", { x: 0.28, y: 1.54 + i*0.48, w: 0.2, h: 0.2,
      fontSize: 9, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
    s.addText(t, { x: 0.56, y: 1.4 + i*0.48, w: 4.1, h: 0.46,
      fontSize: 9.5, color: C.light, valign: "middle", margin: 0 });
  });

  // Contraindications
  s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y: 1.02, w: 4.7, h: 0.35,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("CONTRAINDICATIONS", { x: 5.1, y: 1.02, w: 4.7, h: 0.35,
    fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const contra = [
    ["Minor/rapidly resolving symptoms", "Risk-benefit unfavourable; may resolve spontaneously"],
    ["Stroke / serious head trauma within 3 months", "Recently infarcted brain = high haemorrhagic transformation risk"],
    ["Known history of ICH", "Prior ICH = underlying vascular abnormality; catastrophic re-bleed"],
    ["SBP >185 or DBP >110 at treatment time", "Can treat BP first, then give tPA if achieved"],
    ["Symptoms suggestive of SAH", "tPA in SAH = catastrophic outcome"],
    ["GI or GU haemorrhage within 21 days", "Systemic haemorrhage risk"],
    ["Arterial puncture at non-compressible site within 7 days", "Bleeding risk at puncture site"],
    ["Heparin within 48h + elevated APTT", "Active anticoagulation"],
    ["Platelets < 100,000 / ΞΌL", "Coagulopathy; inadequate haemostasis"],
  ];
  contra.forEach((r, i) => {
    const y = 1.4 + i * 0.42;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y, w: 4.7, h: 0.4,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.RECTANGLE, { x: 5.1, y, w: 0.08, h: 0.4,
      fill: { color: C.accent1 }, line: { color: C.accent1 } });
    s.addText(r[0], { x: 5.22, y: y+0.01, w: 4.5, h: 0.2,
      fontSize: 8, bold: true, color: C.light, margin: 0 });
    s.addText(r[1], { x: 5.22, y: y+0.22, w: 4.5, h: 0.17,
      fontSize: 7.5, color: C.muted, margin: 0 });
  });

  pearl(s, "TIME IS BRAIN: every minute = ~1.9 million neurons die. Door-to-needle target < 60 min. The 4.5h window extended from 3h by ECASS III trial. Beyond 4.5h β€” thrombectomy in eligible large vessel occlusion patients.",
    0.2, 5.2, 9.6, 0.3);
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 – COMPLICATIONS + BARTHEL INDEX
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Complications & Functional Assessment", "Daily ward vigilance Β· Barthel Index");

  // Medical complications
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.02, w: 4.75, h: 0.3,
    fill: { color: C.accent1 }, line: { color: C.accent1 } });
  s.addText("MEDICAL COMPLICATIONS β€” Proactively Screen Daily", { x: 0.2, y: 1.02, w: 4.75, h: 0.3,
    fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  const medComp = [
    { c: "Aspiration Pneumonia", d: "Most common cause of early death after stroke\nDysphagia in 28–65% β€” water swallow test BEFORE oral intake\nNil by mouth β†’ NG tube until SLT clears patient", col: C.accent1 },
    { c: "UTI", d: "Urinary retention (bladder areflexia), catheter use\nAvoid urinary catheter if possible", col: C.accent3 },
    { c: "DVT / PE", d: "Immobility + limb paresis + post-stroke hypercoagulable state\nCompression stockings + LMWH + early mobilisation", col: C.accent4 },
    { c: "Pressure Sores", d: "Immobility + nutritional deficiency\n2-hourly repositioning; pressure-relieving mattress", col: C.accent3 },
    { c: "Epileptic Seizures", d: "Cortical irritation β€” 3–10% of stroke patients\nAED if seizures occur; seizure precautions", col: C.accent2 },
  ];
  medComp.forEach((r, i) => {
    const y = 1.35 + i * 0.67;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 4.75, h: 0.65,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 0.08, h: 0.65,
      fill: { color: r.col }, line: { color: r.col } });
    s.addText(r.c, { x: 0.34, y: y+0.03, w: 4.53, h: 0.24,
      fontSize: 9, bold: true, color: r.col, margin: 0 });
    s.addText(r.d, { x: 0.34, y: y+0.3, w: 4.53, h: 0.32,
      fontSize: 8, color: C.muted, margin: 0, wrap: true });
  });

  // Neurological complications
  s.addShape(pres.shapes.RECTANGLE, { x: 5.15, y: 1.02, w: 4.65, h: 0.3,
    fill: { color: C.accent3 }, line: { color: C.accent3 } });
  s.addText("NEUROLOGICAL COMPLICATIONS", { x: 5.15, y: 1.02, w: 4.65, h: 0.3,
    fontSize: 8.5, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });

  const neurComp = [
    { c: "Malignant MCA Syndrome", d: "CT >50% MCA territory + septum pellucidum shift >5mm\nPeak day 3–5 β†’ herniation\nDecompressive hemicraniectomy (age <60, within 48h)", col: C.accent1 },
    { c: "Haemorrhagic Transformation", d: "Reperfusion of BBB-damaged ischaemic tissue\nEspecially post-tPA and cardioembolic stroke\nRepeat CT if neurological deterioration", col: C.accent1 },
    { c: "Cerebral Vasospasm (SAH)", d: "Blood breakdown products β†’ smooth muscle contraction\nPeak day 5–14 β†’ delayed cerebral ischaemia\nNimodipine prophylaxis", col: C.accent3 },
    { c: "Hydrocephalus", d: "IVH or SAH blocking CSF drainage\nEarly post-haemorrhage; EVD may be needed", col: C.accent2 },
  ];
  neurComp.forEach((r, i) => {
    const y = 1.35 + i * 0.82;
    s.addShape(pres.shapes.RECTANGLE, { x: 5.15, y, w: 4.65, h: 0.78,
      fill: { color: i%2===0?C.card:C.panel }, line: { color: i%2===0?C.card:C.panel } });
    s.addShape(pres.shapes.RECTANGLE, { x: 5.15, y, w: 0.08, h: 0.78,
      fill: { color: r.col }, line: { color: r.col } });
    s.addText(r.c, { x: 5.3, y: y+0.04, w: 4.42, h: 0.24,
      fontSize: 9, bold: true, color: r.col, margin: 0 });
    s.addText(r.d, { x: 5.3, y: y+0.32, w: 4.42, h: 0.42,
      fontSize: 8, color: C.muted, margin: 0, wrap: true });
  });

  // Barthel strip
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 5.08, w: 9.6, h: 0.42,
    fill: { color: C.panel }, line: { color: C.accent2, pt: 1 } });
  s.addText([
    { text: "BARTHEL INDEX (0–100):  ", options: { bold: true, color: C.accent2, fontSize: 9 } },
    { text: "Bathing Β· Toileting Β· Dressing Β· Hygiene Β· Grooming Β· Eating Β· Mobility Β· Transfers Β· Recreation Β· Speech & Higher functions  ", options: { color: C.light, fontSize: 8 } },
    { text: "| Also: PT & OT started? Social support? Home environment barriers?", options: { color: C.muted, fontSize: 7.5, italic: true } }
  ], { x: 0.3, y: 5.08, w: 9.4, h: 0.42, valign: "middle", margin: 3 });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 – CLINICAL PEARLS RAPID-FIRE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "Clinical Pearls β€” Rapid Fire", "High-yield bedside rules for ward rounds and exams");

  const pearls = [
    { p: "'Sudden' onset = vascular", d: "Instantaneous maximal deficit. Gradual onset β†’ tumour, abscess, SDH, metabolic" },
    { p: "Bilateral weakness β‰  stroke", d: "Think metabolic, bilateral lesions, spinal cord. Unilateral = stroke until proven otherwise" },
    { p: "Crossed signs = brainstem", d: "Ipsilateral CN deficit + contralateral limb = brainstem lesion. Pathognomonic" },
    { p: "No cortical signs = lacunar", d: "Aphasia / neglect / hemianopia EXCLUDE lacunar syndrome" },
    { p: "Check glucose FIRST", d: "Hypoglycaemia <2.8 mmol/L perfectly mimics stroke. Reversible. Give glucose before tPA" },
    { p: "NCCT normal β‰  no stroke", d: "CT excludes haemorrhage; ischaemia invisible for 6–24h. MRI DWI detects within minutes" },
    { p: "Permissive HTN in ischaemia", d: "Do NOT lower BP <220/120 (without tPA). Autoreg shifts right β€” penumbra needs the pressure" },
    { p: "Fever kills the penumbra", d: "1Β°C rise = 10% ↑ metabolic demand. Treat fever aggressively from minute 1" },
    { p: "Dysphagia screen before mouth", d: "28–65% of acute strokes. Aspiration pneumonia = most common cause of early death" },
    { p: "Carotid bruit can disappear", d: ">95% ICA stenosis β†’ flow too low β†’ bruit disappears. Always do duplex regardless" },
    { p: "Charcot-Bouchard = HTN vessel", d: "Same microaneurysms that occlude β†’ lacunar infarct will rupture β†’ deep ICH (HTN)" },
    { p: "Cerebellar ICH >3 cm = surgery", d: "Small posterior fossa β†’ rapid brainstem compression + hydrocephalus. Neurosurgical emergency" },
    { p: "AF + stroke β†’ anticoagulate", d: "Antiplatelets are insufficient for AF. NOAC first choice; timing depends on stroke severity" },
    { p: "'Worst headache of life' = SAH", d: "Thunderclap onset. CT first (98% within 12h), then LP at 12h if CT negative (xanthochromia)" },
  ];

  // 2 columns Γ— 7 rows
  const half = 7;
  pearls.forEach((p, i) => {
    const col = i < half ? 0 : 1;
    const row = i < half ? i : i - half;
    const x = col === 0 ? 0.2 : 5.1;
    const y = 1.02 + row * 0.63;
    s.addShape(pres.shapes.RECTANGLE, { x, y, w: 4.72, h: 0.58,
      fill: { color: C.panel },
      line: { color: row % 2 === 0 ? C.accent1 : C.accent2, pt: 1 }
    });
    s.addText("β˜… " + p.p, { x: x+0.1, y: y+0.04, w: 4.52, h: 0.24,
      fontSize: 9, bold: true, color: row%2===0 ? C.accent1 : C.accent2, margin: 0 });
    s.addText(p.d, { x: x+0.1, y: y+0.3, w: 4.52, h: 0.24,
      fontSize: 8, color: C.light, margin: 0 });
  });
}


// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 – THE 3 BEDSIDE QUESTIONS + SOURCES
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide(); bg(s);
  headerBar(s, "The 3 Bedside Questions", "Ask these on every stroke patient β€” in order");

  const questions = [
    {
      n: "1",
      q: "What is the temporal profile?",
      a: "SUDDEN onset β†’ vascular (stroke/TIA)\nGradual (weeks) β†’ tumour\nDays + fever β†’ abscess/encephalitis\nMinutes + seizure history β†’ Todd's paresis",
      col: C.accent2,
    },
    {
      n: "2",
      q: "Which vascular territory?",
      a: "Anterior: face+arm+leg + cortical signs\nPosterior: D-V-F triad + crossed signs\nLacunar: pure motor/sensory, NO cortical signs\n→ Localise before imaging",
      col: C.accent3,
    },
    {
      n: "3",
      q: "What is the aetiology?",
      a: "Atherosclerosis: RF + TIA + bruit\nCardioembolism: AF + murmur + maximal deficit\nLacunar: HTN + DM + no cortical signs\nYoung: vasculitis + thrombophilia + dissection",
      col: C.accent1,
    },
  ];

  questions.forEach((q, i) => {
    const y = 1.05 + i * 1.4;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y, w: 9.6, h: 1.33,
      fill: { color: C.panel }, line: { color: q.col, pt: 2 } });
    s.addShape(pres.shapes.OVAL, { x: 0.35, y: y+0.3, w: 0.72, h: 0.72,
      fill: { color: q.col }, line: { color: q.col } });
    s.addText(q.n, { x: 0.35, y: y+0.3, w: 0.72, h: 0.72,
      fontSize: 24, bold: true, color: C.bg, align: "center", valign: "middle", margin: 0 });
    s.addText(q.q, { x: 1.22, y: y+0.08, w: 8.4, h: 0.38,
      fontSize: 13, bold: true, color: q.col, margin: 0 });
    s.addText(q.a, { x: 1.22, y: y+0.5, w: 8.3, h: 0.75,
      fontSize: 9, color: C.light, margin: 0, wrap: true });
  });

  // Source footer
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 5.25, w: 10, h: 0.375,
    fill: { color: C.card }, line: { color: C.card } });
  s.addText("Sources: Faculty PDF (Stroke vith del.pdf) Β· Fuster & Hurst's The Heart 15E Β· Neuroanatomy through Clinical Cases 3E Β· Bradley & Daroff's Neurology in Clinical Practice", {
    x: 0.2, y: 5.27, w: 9.6, h: 0.33,
    fontSize: 7, color: C.muted, valign: "middle", margin: 0, italic: true
  });
}


// ── WRITE ─────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/stroke-presentation/Approach_to_Stroke_Ward_Rounds.pptx" })
  .then(() => console.log("Done: Approach_to_Stroke_Ward_Rounds.pptx"))
  .catch(err => { console.error(err); process.exit(1); });
Running Command

cd /home/daytona/workspace/stroke-presentation && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/stroke-presentation/

Your presentation is ready β€” 489 KB, 13 slides:

Approach to Stroke Ward Rounds

Presentation Β· PPTX


What's inside (13 slides):
#SlideContent
1TitleDeep navy + red design, five topic badges
2Definition & PathophysiologyStroke vs TIA, why "sudden" matters, Penumbra vs Core diagram with CBF thresholds
3History-TakingOpening case, presenting complaints, 5 symptom analysis questions, aetiology history table, stroke mimics column
4Vascular Territory IdentificationAnterior / Posterior / Lacunar - 3 full columns with features, pathophysiology and bedside pearls
5Lacunar Syndromes TableAll 6 syndromes - clinical features, location, artery (from Neuroanatomy through Clinical Cases 3E + Fuster 15E)
6Aetiology β€” TOAST Classification4 quadrant layout: atherosclerosis, cardioembolism, lacunar, vasculitis - each with pathophysiology, history clues, prevention
7Physical Examination3 columns - general exam, neurological exam (pronator drift, UMN pattern, higher functions), cardiovascular exam
8InvestigationsImmediate first-hour panel vs second-line; young stroke screen (APS, thrombophilia, HIV, sickle cell)
9Acute Management4 Enemies of the Penumbra + ischaemic specific treatment (aspirin, tPA, thrombectomy, hemicraniectomy) + ICH management side-by-side
10Thrombolysis CriteriaFaculty PDF indications vs contraindications with pathophysiological reasoning for each
11Complications + BarthelMedical complications (aspiration pneumonia first), neurological complications (malignant MCA, vasospasm), Barthel Index strip
12Clinical Pearls Rapid-Fire14 bedside rules in 2-column layout
133 Bedside QuestionsThe master framework as 3 numbered cards with source footer
Design: Deep navy with emergency red accents, teal for processes, amber for warnings - matches the clinical urgency of stroke management. Built directly from your faculty PDF + textbook content.
This is a shared conversation. Sign in to Orris to start your own chat.