Hello, Rish. So, I want you to explain me about central nervous system pathology because I have my exams, and I am a student in Georgia currently, and it's MCQ-based exam. So, I want, like, the high-heeled, uh, mnemonic type, so I can finish the chapter as soon as I can. So, uh, I... Because... And also, if possible, endocrine with mnemonics or some digital charts, so I can memorize it, or flowcharts, so that I will ace my exams and make sure that... Next semester, I'm doing internals.

Reading File
Great, I have the skill loaded. Before I dive into building your study material, let me clarify a couple things so I give you exactly what you need.
Asking for Preferences
Perfect - 1st year preclinical, all CNS pathology + all endocrine topics. Let me pull everything from the textbooks in parallel right now.
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
The headings_fts search returned no results and I've exhausted my DB query budget. I have enough knowledge to give you an outstanding, exam-focused study guide from scratch. Let me now compile your complete CNS + Endocrine high-yield notes with mnemonics and flowcharts.Here is your complete high-yield MCQ study guide. I've organized everything with mnemonics, flowcharts (text-based), and key MCQ traps for 1st year preclinical exams.

🧠 CNS PATHOLOGY - HIGH-YIELD MCQ GUIDE


1. DEMYELINATING DISEASES

Multiple Sclerosis (MS)

Mnemonic: "MS = Many Symptoms"
FeatureKey Fact
AgeYoung women (20-40)
PathologyDemyelination of white matter (oligodendrocytes destroyed)
LocationPeriventricular plaques (hallmark)
Key findingInternuclear ophthalmoplegia (MLF lesion)
CSFOligoclonal IgG bands
MRIDawson's fingers (periventricular lesions perpendicular to ventricles)
Mnemonic for MS symptoms: "SPASM"
  • Sensory loss (paresthesia)
  • Pain (optic neuritis = painful vision loss)
  • Ataxia (cerebellar)
  • Sphincter dysfunction (bladder)
  • Motor weakness (UMN signs)
MCQ Traps:
  • Relapsing-remitting = most common type
  • Uhthoff's phenomenon = symptoms worsen with HEAT
  • Lhermitte's sign = electric shock down spine on neck flexion
  • Drug: Beta-interferon (modifying), steroids (acute attack)

Guillain-Barre Syndrome (GBS)

Mnemonic: "GBS = Goes Bottom-to-Shoulder" (ascending paralysis)
FeatureKey Fact
TriggerPost-infection (Campylobacter jejuni #1)
PathologyDemyelination of peripheral nerves (Schwann cells)
PresentationAscending flaccid paralysis, areflexia
CSFAlbuminocytologic dissociation (high protein, normal cells)
RiskRespiratory failure
TreatmentIVIG or Plasmapheresis
MCQ Trap: GBS is PERIPHERAL (LMN) - flaccid paralysis, areflexia. MS is CENTRAL (UMN) - spastic paralysis, hyperreflexia.

2. BRAIN TUMORS

Classification Mnemonic: "GAME"

  • Gliomas (most common overall - astrocytoma, GBM)
  • Adenocarcinoma mets (most common brain tumor in adults = METASTATIC)
  • Meningioma (most common BENIGN, extra-axial)
  • Ependymoma (4th ventricle in children)

Glioblastoma Multiforme (GBM)

Mnemonic: "GBM = Gross Bad Mass"
FeatureKey Fact
GradeWHO Grade IV (most malignant)
LocationCerebral hemisphere (crosses corpus callosum = "butterfly glioma")
HistologyPseudopalisading necrosis around blood vessels
MarkerGFAP positive
Prognosis15 months median survival

High-Yield Tumor Table

TumorLocationAgeKey MCQ Fact
Pilocytic astrocytomaCerebellumChildRosenthal fibers, BENIGN (grade I)
MedulloblastomaCerebellum (4th ventricle)ChildHomer-Wright rosettes, radiosensitive
Ependymoma4th ventricleChildPerivascular pseudorosettes
MeningiomaParasagittal/sphenoidAdult FPsammoma bodies, whorled pattern
SchwannomaCN VIII (acoustic)AdultS100+, bilateral = NF2
OligodendrogliomaFrontal lobeAdultFried egg cells, 1p/19q deletion
CraniopharyngiomaSuprasellarChildCalcification, cholesterol crystals
GBMTemporal/frontalElderlyButterfly pattern, pseudopalisading necrosis
Mnemonic for Pediatric tumors: "CAME" (all in cerebellum/posterior fossa)
  • Craniopharyngioma (suprasellar)
  • Astrocytoma (pilocytic, cerebellum)
  • Medulloblastoma (cerebellum)
  • Ependymoma (4th ventricle)

3. CEREBROVASCULAR DISEASE (STROKE)

Flowchart: Stroke Classification

                    STROKE
                   /      \
           ISCHEMIC        HEMORRHAGIC
           (87%)           (13%)
          /      \          /        \
      Thrombotic  Embolic  Intracerebral  Subarachnoid
      (plaque)   (from     hemorrhage     hemorrhage
                  heart)   (HTN #1)       (aneurysm #1)

Key Facts by Stroke Type

Mnemonic: "THEFT" for Ischemic Stroke risk factors
  • Thrombus / TIA
  • Hypertension
  • Elevated cholesterol
  • Fib (Atrial fibrillation) - embolic
  • Tobacco / Diabetes
Intracerebral Hemorrhage:
  • Cause: Hypertension (#1) β†’ Charcot-Bouchard microaneurysms
  • Location: Basal ganglia (putamen most common), then thalamus, pons, cerebellum
Subarachnoid Hemorrhage (SAH):
  • Cause: Berry aneurysm rupture (#1) - at Circle of Willis bifurcations
  • Presentation: "Worst headache of my life" (thunderclap)
  • Association: ADPKD, Marfan syndrome
  • CSF: Xanthochromia (yellow) = distinguishes SAH from traumatic tap
Epidural vs Subdural Hematoma:
FeatureEpiduralSubdural
VesselMiddle meningeal arteryBridging veins
BloodLens-shaped (biconvex)Crescent-shaped
Lucid intervalYES (classic)Sometimes
CauseTemporal bone fractureElderly, alcoholics, trauma
Mnemonic: "EDH = Artery = Fast; SDH = Vein = Slow"

4. NEURODEGENERATIVE DISEASES

The Big 4 - Mnemonic: "APAL"

  • Alzheimer's
  • Parkinson's
  • ALS (Amyotrophic Lateral Sclerosis)
  • Lewy Body Dementia

Alzheimer's Disease

Mnemonic: "ABCs of Alzheimer's"
  • Amyloid beta plaques (senile plaques) - extracellular
  • Brain atrophy (hippocampus first - memory)
  • Chromosome 21 (Down syndrome = early Alzheimer's), also ApoE4, APP, Presenilin
  • Downregulation of ACh (treatment = acetylcholinesterase inhibitors: Donepezil)
  • Early symptom = short-term memory loss
  • Fibrillary tangles (Tau protein) - intracellular
MCQ Trap: Plaques = extracellular (beta-amyloid). Tangles = intracellular (hyperphosphorylated Tau).

Parkinson's Disease

Mnemonic: "TRAP" for symptoms
  • Tremor (resting, pill-rolling, 4-6 Hz)
  • Rigidity (cogwheel)
  • Akinesia / bradykinesia
  • Postural instability
Pathology: Loss of dopaminergic neurons in Substantia Nigra pars compacta Histology: Lewy bodies (alpha-synuclein inclusions)
Dopamine Pathway Mnemonic: "SMASH"
  • Substantia nigra β†’ Mesolimbic and Mesocortical paths β†’ Action, Smooth movement, Hormone (PRL)
Treatment: "SLAM DUNK"
  • Levodopa/Carbidopa (gold standard)
  • Dopamine agonists (Pramipexole, Ropinirole)
  • MAO-B inhibitors (Selegiline)

ALS (Lou Gehrig's Disease)

  • Both UMN + LMN involvement (UNIQUE)
  • No sensory, cognitive, or autonomic involvement
  • Mutation: SOD1 gene
  • Mnemonic: "ALS = A(ll) L(imbs) Spared of Sensation"

Quick Dementia Comparison

FeatureAlzheimer'sVascular DementiaLewy BodyFrontotemporal
OnsetGradualStepwiseGradualGradual
MemoryEarly lossVariableVariablePreserved early
HallucinationsLateRareEARLY, visualRare
ParkinsonismLatePossibleYES, earlyNo
Key pathPlaques/tanglesInfarctsLewy bodiesTau/TDP-43

5. CNS INFECTIONS

Classification Mnemonic: "BVFP"

  • Bacterial meningitis
  • Viral meningitis (aseptic)
  • Fungal (Cryptococcus)
  • Prion diseases

Bacterial Meningitis by Age

Mnemonic: "LiSA SHINES" by age group:
AgeBugMnemonic
Newborn (0-3m)Group B Strep, E. coli, Listeria"GEL"
Child (3m-18y)N. meningitidis, S. pneumoniae, H. influenzae"NMSH"
AdultsS. pneumoniae, N. meningitidis"SN"
Elderly/Immunocomp.S. pneumoniae, Listeria"SPL"
Classic Triad: Fever + Neck stiffness + Altered consciousness Brudzinski's sign: Neck flexion β†’ knee flexion Kernig's sign: Hip flex 90Β° β†’ can't extend knee
CSF findings - Mnemonic: "BAD CSF"
BacterialViralFungal/TB
AppearanceTurbidClearClear/turbid
WBCHigh PMNsHigh LymphsHigh Lymphs
GlucoseVery LOWNormalLow
ProteinVery HIGHSlightly highHigh

Herpes Simplex Encephalitis (HSV-1)

  • Most common VIRAL encephalitis in adults
  • Location: Temporal lobe (limbic system)
  • Presentation: Fever + personality change + temporal lobe seizures
  • Treatment: Acyclovir (IV, STAT!)
  • CSF: PCR for HSV DNA = diagnostic

Cryptococcal Meningitis

  • Seen in HIV/AIDS patients (CD4 <100)
  • Capsule stains with India ink (halo appearance)
  • Antigen test = gold standard (latex agglutination)
  • Treatment: Amphotericin B + Flucytosine

Prion Diseases

  • Caused by misfolded PrP protein (infectious, genetic, or sporadic)
  • Creutzfeldt-Jakob Disease (CJD) = most common prion disease
  • Mnemonic: "CJD = Crazy Jumping Dementia" (myoclonus + rapidly progressive dementia)
  • Histology: Spongiform encephalopathy (vacuolation)


πŸ’Š ENDOCRINE PATHOLOGY - HIGH-YIELD MCQ GUIDE


1. PITUITARY DISORDERS

Pituitary Hormones - Mnemonic: "FLAT PiG" (Anterior)

  • FSH
  • LH
  • ACTH
  • TSH
  • Prolactin
  • iGF-1 (via GH)
  • GH
Posterior pituitary: ADH + Oxytocin (made in hypothalamus, stored in posterior pituitary)

Hyperprolactinemia

Causes - Mnemonic: "PAID"
  • Pituitary adenoma (prolactinoma = #1 cause)
  • Antipsychotics (dopamine antagonists = raise PRL)
  • Idiopathic
  • Dopamine inhibition (hypothyroidism, stalk compression)
Effects: Women = amenorrhea + galactorrhea. Men = impotence + gynecomastia. Treatment: Dopamine agonist = Cabergoline / Bromocriptine

Acromegaly (excess GH in adults) / Gigantism (in children)

  • Cause: GH-secreting pituitary adenoma
  • Features: Enlarged hands, feet, jaw (prognathism), organomegaly, hypertension
  • Diagnosis: IGF-1 level + failure to suppress GH after oral glucose
  • Treatment: Surgery (transsphenoidal), then Octreotide (somatostatin analogue)

Diabetes Insipidus (DI)

            DIABETES INSIPIDUS
            (Dilute urine, concentrated blood)
                /            \
          CENTRAL DI        NEPHROGENIC DI
       (ADH deficiency)    (ADH resistance)
       Cause: trauma,       Cause: Lithium,
       tumors, surgery      hypercalcemia, genetic
            |                    |
       ADH β†’ WORKS          ADH β†’ NO EFFECT
            |                    |
    Treatment: Desmopressin  Treatment: Thiazides
                              + low sodium diet
Urine osmolality in DI: < 300 mOsm/kg (dilute) MCQ Trap: DI vs Psychogenic polydipsia - water deprivation test distinguishes them.

Pituitary Adenomas Summary

Adenoma TypeHormonePresentation
ProlactinomaProlactinAmenorrhea, galactorrhea (F); Impotence (M)
SomatotrophGHAcromegaly (adult), Gigantism (child)
CorticotrophACTHCushing's disease
ThyrotrophTSHHyperthyroidism
Non-functioningNoneMass effects (bitemporal hemianopia)
Bitemporal hemianopia = optic chiasm compression (classic pituitary mass sign)

2. THYROID DISORDERS

Quick Overview Flowchart

THYROID DISORDERS
       |
   ____+____
  /         \
HYPO       HYPER
  |           |
Slow Metabolism  Fast Metabolism
  |           |
"SLOW"       "FAST"
S-lugish     F-lushing/sweating
L-ow T3/T4   A-rrhythmias (AF)
O-besity     S-kinny/weight loss
W-arm intolerance  T-remor

Hypothyroidism

Mnemonic: "SLOW BM"
  • Sensitivity to cold
  • Lethargy, depression
  • Obesity (weight gain)
  • Water retention (puffy face, myxedema)
  • Bradycardia
  • Menorrhagia + constipation
Causes: Hashimoto's thyroiditis (#1 in developed countries), iodine deficiency (#1 worldwide), post-thyroidectomy Hashimoto's: Autoimmune, anti-TPO + anti-thyroglobulin antibodies, Hurthle cells, lymphocytic infiltrate Treatment: Levothyroxine (T4)

Hyperthyroidism

Mnemonic: "FAST THY"
  • Flushing, heat intolerance
  • Atrial fibrillation, anxiety
  • Skinny (weight loss, diarrhea)
  • Tremor, tachycardia
  • Thyroid enlargement (goiter)
  • High T3/T4
  • Young women (#1 demographic for Graves')
Causes Mnemonic: "GMTT"
  • Graves' disease (#1 cause of hyperthyroidism)
  • Multinodular goiter
  • Thyroid adenoma (toxic)
  • Thyroiditis (early/transient)
Graves' Disease Specifics:
  • Autoimmune: TSH-receptor stimulating antibodies (TRAb/LATS)
  • Classic triad: Hyperthyroidism + Exophthalmos + Pretibial myxedema
  • Treatment: Propylthiouracil (PTU) or Methimazole, Radioiodine (I-131), Beta-blockers (symptom control)
  • PTU preferred in PREGNANCY (1st trimester)

Thyroid Cancer Types

Mnemonic: "PaFoMeAn" = Prognosis order (best to worst)
TypeKey FactMnemonic
Papillary (most common, 80%)Psammoma bodies, "Orphan Annie" nuclei, RET/PTC mutationPapillary = best Prognosis
Follicular (10%)Hematogenous spread, vascular invasionFollicular = Far spread
Medullary (5-8%)C-cells β†’ Calcitonin, amyloid stroma, RET mutationMedullary = MEN2
Anaplastic (<5%)Elderly, worst prognosis, rapidly fatalAnaplastic = Annihilation
MCQ Traps:
  • Medullary thyroid cancer + MEN2A = mutation in RET proto-oncogene
  • Radioiodine works for papillary and follicular (well-differentiated) but NOT medullary or anaplastic
  • Cervical lymph node mets = papillary (not a bad sign - still good prognosis)

3. ADRENAL DISORDERS

Adrenal Zones - Mnemonic: "GFR" (from outside in)

  • Glomerulosa β†’ Glucocorticoids? No! β†’ Mineralocorticoids (Aldosterone)
  • Fasciculata β†’ Glucocorticoids (Cortisol) - Longest zone
  • Reticularis β†’ Androgens (DHEA)
  • Medulla β†’ Catecholamines (Epinephrine >> Norepinephrine)
Memory trick: "Go Find Rex" - and Rex lives in the Medulla

Cushing's Syndrome (Excess Cortisol)

Mnemonic: "CUSHINGS"
  • Central obesity (moon face, buffalo hump)
  • Urine cortisol elevated (24h)
  • Strain marks (purple striae)
  • Hypertension
  • Insulin resistance (hyperglycemia)
  • No menses (amenorrhea)
  • Glucose elevated
  • Skin thinning + easy bruising
Causes Flowchart:
HIGH CORTISOL?
       |
  24h urine cortisol elevated
       |
   ACTH level?
   /          \
HIGH ACTH    LOW ACTH
(ACTH-dep.)  (ACTH-indep.)
  /    \          |
Pituitary  Ectopic  Adrenal tumor
adenoma    (SCLC#1)  (adenoma/carcinoma)
"Cushing's  "Ectopic    "Primary
  DISEASE"   ACTH"      adrenal"
Dexamethasone suppression test:
  • Low-dose DST: Screens for any Cushing's
  • High-dose DST: Suppresses pituitary (Cushing's disease) but NOT ectopic ACTH or adrenal tumor

Addison's Disease (Primary Adrenal Insufficiency)

Mnemonic: "SHADE"
  • Skin hyperpigmentation (ACTH excess β†’ MSH)
  • Hypotension + Hyperkalemia
  • Anemia (normocytic)
  • Dehydration (low aldosterone β†’ Na wasting)
  • Electrolyte: Low Na, High K
Causes: Autoimmune (#1 in West), TB (#1 worldwide), metastasis MCQ Trap: Skin hyperpigmentation = PRIMARY adrenal insufficiency (not secondary, because secondary has LOW ACTH)
Addisonian Crisis: Treat with IV hydrocortisone + IV saline

Hyperaldosteronism (Conn's Syndrome)

Mnemonic: "HANK"
  • Hypertension (resistant, no edema)
  • Alkalosis (metabolic)
  • No renin (low renin = primary)
  • K+ low (hypokalemia)
Cause: Adrenal adenoma (#1 = Conn's syndrome) or bilateral hyperplasia Diagnosis: High aldosterone + Low renin ratio Treatment: Surgical (adenoma) or Spironolactone (aldosterone antagonist)

Pheochromocytoma

Mnemonic: "5 P's of Pheo"
  • Paroxysmal hypertension
  • Palpitations
  • Perspiration (diaphoresis)
  • Pallor
  • Pain (headache)
Rule of 10s:
  • 10% bilateral
  • 10% malignant
  • 10% extra-adrenal (paraganglioma)
  • 10% in children
  • 10% familial (MEN2, NF1, VHL)
Diagnosis: Urine/plasma metanephrines (most sensitive) Treatment: Alpha-blockade FIRST (Phenoxybenzamine), THEN Beta-blockade, THEN surgery MCQ Trap: NEVER give beta-blocker first (unopposed alpha = hypertensive crisis)

4. DIABETES MELLITUS

Type 1 vs Type 2

FeatureType 1Type 2
PathologyAutoimmune beta-cell destructionInsulin resistance + relative deficiency
Age<30 (child/young adult)>40 (middle-aged/elderly)
BodyThinObese
KetoacidosisYES (DKA)Rare (HHS instead)
AutoantibodiesAnti-GAD, anti-islet cellNone
HLADR3, DR4No HLA link
TreatmentInsulin ONLYLifestyle β†’ Metformin β†’ add-ons β†’ Insulin

Diabetic Complications - Mnemonic: "CRAMPS"

  • Cardiovascular (MI, stroke - #1 cause of death)
  • Retinopathy (microvascular, #1 cause of blindness in adults)
  • Atherosclerosis (macrovascular)
  • Micro-albuminuria β†’ nephropathy (Kimmelstiel-Wilson nodules)
  • Peripheral neuropathy ("stocking-glove" sensory loss)
  • Susceptibility to infections

DKA vs HHS

FeatureDKA (Type 1)HHS (Type 2)
Glucose>250 mg/dL>600 mg/dL
pH<7.3 (acidosis)Normal (>7.3)
KetonesYESMinimal/absent
OsmolalityMildly elevated>320 mOsm/kg
Mortality~1%~15%
TreatmentIV saline + Insulin + K+IV saline + Insulin

Insulin Types - Mnemonic: "RAIN"

  • Rapid (Lispro, Aspart) - with meals
  • Acute (Regular insulin) - 30 min before meals
  • Intermediate (NPH) - twice daily
  • Night/long (Glargine, Detemir) - once daily basal

Oral Antidiabetics Summary

DrugMechanismKey MCQ Fact
MetforminDecreases hepatic gluconeogenesis#1 for T2DM, NO hypoglycemia, lactic acidosis risk
Sulfonylureas (Glipizide)Stimulates insulin secretionCan cause hypoglycemia
Thiazolidinediones (Pioglitazone)PPAR-Ξ³ agonistHepatotoxicity, weight gain
GLP-1 agonists (Liraglutide)Incretin effect + weight lossUsed in obese T2DM
SGLT2 inhibitors (Empagliflozin)GlucosuriaUrinary infections, ketoacidosis risk
DPP-4 inhibitors (Sitagliptin)Incretin effectPancreatitis risk

SUPER HIGH-YIELD RECALL TABLE

"One Line Killers" - MCQ Instant Picks

Clue in questionAnswer
Periventricular lesions on MRI in young womanMultiple Sclerosis
Ascending paralysis after CampylobacterGBS
Worst headache of my lifeSubarachnoid Hemorrhage (Berry aneurysm)
Xanthochromia in CSFSAH
Temporal lobe + fever + personality changeHSV Encephalitis β†’ Acyclovir
Pill-rolling tremor + cogwheel rigidityParkinson's - Lewy bodies
Beta-amyloid plaques + neurofibrillary tanglesAlzheimer's Disease
"Orphan Annie" nuclei + psammoma bodiesPapillary thyroid cancer
Calcitonin-secreting tumorMedullary thyroid cancer (MEN2)
High aldosterone + low renin + hypokalemiaConn's syndrome
Paroxysmal hypertension + diaphoresisPheochromocytoma
Skin hyperpigmentation + low Na + high KAddison's Disease
Moon face + buffalo hump + striaeCushing's syndrome
Bitemporal hemianopiaPituitary tumor (optic chiasm compression)
High protein + normal cells in CSFGBS (albuminocytologic dissociation)
India ink + HIVCryptococcus meningitis
Spongiform vacuolation + myoclonusCJD (prion disease)
Butterfly glioma crossing corpus callosumGBM
Homer-Wright rosettes in cerebellum (child)Medulloblastoma

FINAL EXAM STRATEGY TIPS

  1. CNS tumors: Always think Location + Age + Histology triad
  2. Strokes: Ischemic = clot, Hemorrhagic = vessel rupture - know each vessel territory
  3. Dementia: Compare features side by side (visual hallucinations = Lewy Body)
  4. Thyroid: Papillary is most common + best prognosis; Anaplastic = worst
  5. Adrenal: Know the "GFR" zones cold - they love to test which zone makes what hormone
  6. DM: Know DKA vs HHS distinguishing features, and which drug causes hypoglycemia (sulfonylureas - yes; Metformin - no)
  7. Mnemonics to master first: TRAP (Parkinson's), CUSHINGS, SLOW BM, 5 P's of Pheo

Good luck with your internals! These are the classic MCQ patterns - if you want me to generate a printable PDF study card, make practice MCQs, or go deeper on any specific topic, just say the word.That's your complete high-yield exam guide! Here's a quick summary of what's covered:
CNS Pathology (5 major topics):
  • Demyelinating diseases - MS + GBS with TRAP, SPASM, and GAME mnemonics
  • Brain tumors - full table with locations, ages, histology, and the "CAME" pediatric mnemonic
  • Cerebrovascular disease - stroke flowchart + EDH vs SDH comparison
  • Neurodegeneration - Alzheimer's ABCs, Parkinson's TRAP, ALS unique features, dementia comparison table
  • CNS infections - CSF table (Bacterial/Viral/Fungal), meningitis bugs by age, HSV, Cryptococcus, prions
Endocrine Pathology (4 major topics):
  • Pituitary - FLAT PiG hormones, prolactinoma, acromegaly, DI flowchart
  • Thyroid - Hypo/Hyper comparison, Graves' specifics, cancer types ranked by prognosis with "PaFoMeAn"
  • Adrenal - GFR zone mnemonic, Cushing's dexamethasone test flowchart, Addison's SHADE, Pheo's 5 P's + Rule of 10s
  • Diabetes - DKA vs HHS table, drug mechanisms, CRAMPS complications
The "One Line Killers" table at the end is your fastest revision tool - go through it the night before your exam. Want me to turn any of this into a downloadable PDF or create practice MCQs to test yourself?

Make a downloadable PowerPoint presentation with flowcharts and diagrams

Reading File
Reading File
Reading File
I have everything I need. Let me build the full PowerPoint now.
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/med-study-pptx

Writing File

~/med-study-pptx/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "CNS & Endocrine Pathology - High Yield MCQ Study Guide";
pres.author = "Orris Study Guide";

// ─── THEME COLORS ────────────────────────────────────────────────────────────
const C = {
  navy:    "0D1B2A",
  darkBg:  "111827",
  teal:    "0EA5E9",
  tealDk:  "0369A1",
  green:   "10B981",
  red:     "EF4444",
  orange:  "F59E0B",
  purple:  "8B5CF6",
  white:   "FFFFFF",
  offWhite:"F1F5F9",
  gray:    "94A3B8",
  lightGray:"E2E8F0",
  cardBg:  "1E293B",
  cardBg2: "162032",
  accent:  "38BDF8",
};

// ─── HELPER: slide background ────────────────────────────────────────────────
function darkSlide(slide) {
  slide.background = { color: C.darkBg };
}
function lightSlide(slide) {
  slide.background = { color: C.offWhite };
}

// ─── HELPER: section header bar ──────────────────────────────────────────────
function sectionBar(slide, title, color) {
  slide.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.85, fill: { color: color || C.tealDk }, line: { color: color || C.tealDk } });
  slide.addText(title, { x: 0.2, y: 0, w: 12.9, h: 0.85, fontSize: 22, bold: true, color: C.white, valign: "middle", margin: 0 });
}

// ─── HELPER: card box ────────────────────────────────────────────────────────
function card(slide, x, y, w, h, fillColor) {
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w, h,
    fill: { color: fillColor || C.cardBg },
    line: { color: C.teal, width: 1.5 },
    rectRadius: 0.08,
    shadow: { type: "outer", color: "000000", blur: 8, offset: 3, angle: 135, opacity: 0.3 }
  });
}

// ─── HELPER: small label pill ────────────────────────────────────────────────
function pill(slide, text, x, y, w, h, bg, fg) {
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w, h, fill: { color: bg || C.teal }, line: { color: bg || C.teal }, rectRadius: 0.12 });
  slide.addText(text, { x, y, w, h, fontSize: 9, bold: true, color: fg || C.white, align: "center", valign: "middle", margin: 0 });
}

// ─── HELPER: arrow right ─────────────────────────────────────────────────────
function arrowRight(slide, x, y, w, h, color) {
  slide.addShape(pres.shapes.RIGHT_ARROW, { x, y, w, h, fill: { color: color || C.teal }, line: { color: color || C.teal } });
}
function arrowDown(slide, x, y, w, h, color) {
  slide.addShape(pres.shapes.DOWN_ARROW, { x, y, w, h, fill: { color: color || C.teal }, line: { color: color || C.teal } });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 β€” TITLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  // Top accent bar
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.18, fill: { color: C.teal }, line: { color: C.teal } });
  // Bottom accent bar
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 7.32, w: 13.3, h: 0.18, fill: { color: C.teal }, line: { color: C.teal } });
  // Decorative circles
  s.addShape(pres.shapes.ELLIPSE, { x: 9.5, y: 0.8, w: 3.5, h: 3.5, fill: { color: C.tealDk, transparency: 75 }, line: { color: "000000", transparency: 100 } });
  s.addShape(pres.shapes.ELLIPSE, { x: 10.5, y: 3.5, w: 2.5, h: 2.5, fill: { color: C.purple, transparency: 80 }, line: { color: "000000", transparency: 100 } });
  // Title
  s.addText("CNS & Endocrine Pathology", { x: 0.5, y: 1.5, w: 9.5, h: 1.3, fontSize: 42, bold: true, color: C.white, fontFace: "Calibri" });
  s.addText("High-Yield MCQ Study Guide", { x: 0.5, y: 2.85, w: 9.5, h: 0.8, fontSize: 26, bold: false, color: C.teal, fontFace: "Calibri" });
  // Subtitle row
  s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.75, w: 5.2, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("1st Year Preclinical | MCQ-Focused | Mnemonics & Diagrams", { x: 0.5, y: 3.9, w: 9.5, h: 0.5, fontSize: 14, color: C.gray, fontFace: "Calibri" });
  // Topics pills
  const topics = ["CNS Demyelinating","Brain Tumors","Cerebrovascular","Neurodegeneration","CNS Infections","Pituitary","Thyroid","Adrenal","Diabetes"];
  const pillColors = [C.tealDk, C.purple, C.red, C.green, C.orange, C.teal, C.tealDk, C.purple, C.green];
  topics.forEach((t, i) => {
    const col = i % 5;
    const row = Math.floor(i / 5);
    pill(s, t, 0.5 + col * 2.5, 4.7 + row * 0.55, 2.3, 0.38, pillColors[i]);
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 β€” CNS SECTION INTRO
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 7.5, fill: { color: C.navy }, line: { color: C.navy } });
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.3, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("SECTION 1", { x: 0.6, y: 0.5, w: 12, h: 0.5, fontSize: 14, bold: true, color: C.teal, charSpacing: 4 });
  s.addText("Central Nervous System\nPathology", { x: 0.6, y: 1.1, w: 12, h: 2, fontSize: 48, bold: true, color: C.white, fontFace: "Calibri" });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.2, w: 4, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
  const topics = [
    { label: "01", text: "Demyelinating Diseases", color: C.teal },
    { label: "02", text: "Brain Tumors", color: C.purple },
    { label: "03", text: "Cerebrovascular Disease", color: C.red },
    { label: "04", text: "Neurodegeneration", color: C.green },
    { label: "05", text: "CNS Infections", color: C.orange },
  ];
  topics.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.5 + i * 0.7, w: 0.45, h: 0.45, fill: { color: t.color }, line: { color: t.color } });
    s.addText(t.label, { x: 0.6, y: 3.5 + i * 0.7, w: 0.45, h: 0.45, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(t.text, { x: 1.2, y: 3.52 + i * 0.7, w: 8, h: 0.4, fontSize: 16, color: C.white, valign: "middle", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 β€” DEMYELINATING DISEASES: MS vs GBS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "01 | Demyelinating Diseases: MS vs GBS", C.tealDk);

  // MS Card
  card(s, 0.2, 1.0, 6.2, 5.9, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.0, w: 6.2, h: 0.5, fill: { color: C.tealDk }, line: { color: C.tealDk } });
  s.addText("MULTIPLE SCLEROSIS (MS)", { x: 0.3, y: 1.0, w: 6.0, h: 0.5, fontSize: 13, bold: true, color: C.white, valign: "middle", margin: 0 });

  const msData = [
    ["Mnemonic", "SPASM: Sensory, Pain, Ataxia,\nSphincter, Motor"],
    ["Age/Sex", "Young women 20-40"],
    ["Pathology", "Oligodendrocyte destruction\n→ White matter demyelination"],
    ["Location", "Periventricular plaques\n'Dawson's Fingers' on MRI"],
    ["CSF", "Oligoclonal IgG bands"],
    ["Signs", "Uhthoff's (heat worsens)\nLhermitte's (neck flex = shock)"],
    ["Treatment", "Beta-interferon (modify)\nSteroids (acute attack)"],
  ];
  msData.forEach(([k, v], i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 1.62 + i * 0.73, w: 1.6, h: 0.62, fill: { color: C.teal, transparency: 20 }, line: { color: C.teal } });
    s.addText(k, { x: 0.3, y: 1.62 + i * 0.73, w: 1.6, h: 0.62, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 2.05, y: 1.62 + i * 0.73, w: 4.2, h: 0.62, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });

  // GBS Card
  card(s, 6.9, 1.0, 6.2, 5.9, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 6.9, y: 1.0, w: 6.2, h: 0.5, fill: { color: C.purple }, line: { color: C.purple } });
  s.addText("GUILLAIN-BARRE SYNDROME (GBS)", { x: 7.0, y: 1.0, w: 6.0, h: 0.5, fontSize: 13, bold: true, color: C.white, valign: "middle", margin: 0 });

  const gbsData = [
    ["Mnemonic", "'Goes Bottom-to-Shoulder'\n= Ascending paralysis"],
    ["Trigger", "Post-infection\n(Campylobacter jejuni #1)"],
    ["Pathology", "Schwann cell destruction\n→ Peripheral demyelination"],
    ["Presentation", "Ascending flaccid paralysis\n+ Areflexia"],
    ["CSF", "ALBUMINOCYTOLOGIC\nDISSOCIATION\n(High protein, normal WBC)"],
    ["Risk", "Respiratory failure\n(monitor FVC!)"],
    ["Treatment", "IVIG or Plasmapheresis"],
  ];
  gbsData.forEach(([k, v], i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 7.0, y: 1.62 + i * 0.73, w: 1.6, h: 0.62, fill: { color: C.purple, transparency: 20 }, line: { color: C.purple } });
    s.addText(k, { x: 7.0, y: 1.62 + i * 0.73, w: 1.6, h: 0.62, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 8.65, y: 1.62 + i * 0.73, w: 4.3, h: 0.62, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });

  // MCQ TRAP banner
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 7.0, w: 12.9, h: 0.42, fill: { color: C.red, transparency: 20 }, line: { color: C.red } });
  s.addText("MCQ TRAP:  MS = CENTRAL (UMN) = Spastic + Hyperreflexia  |  GBS = PERIPHERAL (LMN) = Flaccid + Areflexia", { x: 0.3, y: 7.0, w: 12.7, h: 0.42, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 β€” BRAIN TUMORS TABLE
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "02 | Brain Tumors β€” High-Yield Table + GAME Mnemonic", C.purple);

  // GAME mnemonic
  const game = [
    { letter: "G", text: "liomas (most common overall)", color: C.teal },
    { letter: "A", text: "denocarcinoma mets (#1 in adults)", color: C.orange },
    { letter: "M", text: "eningioma (most common BENIGN)", color: C.green },
    { letter: "E", text: "pendymoma (4th ventricle, child)", color: C.purple },
  ];
  game.forEach((g, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2 + i * 3.25, y: 1.0, w: 3.0, h: 0.9, fill: { color: g.color, transparency: 20 }, line: { color: g.color }, rectRadius: 0.07 });
    s.addText(g.letter, { x: 0.2 + i * 3.25, y: 1.0, w: 0.7, h: 0.9, fontSize: 28, bold: true, color: g.color, align: "center", valign: "middle", margin: 0 });
    s.addText(g.text, { x: 0.9 + i * 3.25, y: 1.0, w: 2.4, h: 0.9, fontSize: 10, color: C.white, valign: "middle", margin: 0 });
  });

  // Table
  const headers = ["Tumor", "Location", "Age", "Key MCQ Fact"];
  const rows = [
    ["Pilocytic Astrocytoma", "Cerebellum", "Child", "Rosenthal fibers | BENIGN Grade I"],
    ["Medulloblastoma", "Cerebellum (4th V)", "Child", "Homer-Wright rosettes | Radiosensitive"],
    ["Ependymoma", "4th Ventricle", "Child", "Perivascular pseudorosettes"],
    ["GBM (Grade IV)", "Temporal/Frontal", "Elderly", "Butterfly pattern | Pseudopalisading necrosis"],
    ["Oligodendroglioma", "Frontal lobe", "Adult", "Fried egg cells | 1p/19q deletion"],
    ["Meningioma", "Parasagittal", "Adult F", "Psammoma bodies | Whorled pattern | BENIGN"],
    ["Schwannoma (CN VIII)", "CPA angle", "Adult", "S100+ | Bilateral = NF2"],
    ["Craniopharyngioma", "Suprasellar", "Child", "Calcification | Cholesterol crystals"],
  ];
  const colW = [2.6, 2.2, 1.3, 6.8];
  const colX = [0.2, 2.85, 5.1, 6.45];
  // Header row
  headers.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: colX[ci], y: 2.05, w: colW[ci], h: 0.4, fill: { color: C.purple }, line: { color: C.purple } });
    s.addText(h, { x: colX[ci] + 0.05, y: 2.05, w: colW[ci] - 0.1, h: 0.4, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
  });
  const rowColors = [C.cardBg, C.cardBg2, C.cardBg, C.cardBg2, C.cardBg, C.cardBg2, C.cardBg, C.cardBg2];
  rows.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: colX[ci], y: 2.5 + ri * 0.6, w: colW[ci], h: 0.58, fill: { color: rowColors[ri] }, line: { color: C.teal, transparency: 70 } });
      s.addText(cell, { x: colX[ci] + 0.05, y: 2.5 + ri * 0.6, w: colW[ci] - 0.1, h: 0.58, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  // CAME pill
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 7.08, w: 12.9, h: 0.35, fill: { color: C.orange, transparency: 25 }, line: { color: C.orange }, rectRadius: 0.05 });
  s.addText("PEDIATRIC TUMORS (CAME):  Craniopharyngioma  |  Astrocytoma (pilocytic)  |  Medulloblastoma  |  Ependymoma", { x: 0.3, y: 7.08, w: 12.7, h: 0.35, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 β€” STROKE FLOWCHART
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "03 | Cerebrovascular Disease β€” Stroke Classification Flowchart", C.red);

  // Central STROKE node
  s.addShape(pres.shapes.ELLIPSE, { x: 5.25, y: 1.1, w: 2.8, h: 0.9, fill: { color: C.red }, line: { color: C.red } });
  s.addText("STROKE", { x: 5.25, y: 1.1, w: 2.8, h: 0.9, fontSize: 18, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // Branches
  // Ischemic branch (left)
  s.addShape(pres.shapes.RECTANGLE, { x: 2.2, y: 2.3, w: 0.04, h: 0.6, fill: { color: C.teal }, line: { color: C.teal } }); // line spacer
  arrowDown(s, 2.7, 1.7, 0.3, 0.45, C.teal);
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 1.0, y: 2.2, w: 3.5, h: 0.7, fill: { color: C.tealDk }, line: { color: C.teal }, rectRadius: 0.07 });
  s.addText("ISCHEMIC  (87%)", { x: 1.0, y: 2.2, w: 3.5, h: 0.7, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // Sub: Thrombotic
  arrowDown(s, 1.3, 3.0, 0.3, 0.4, C.teal);
  card(s, 0.3, 3.45, 2.0, 1.5, C.cardBg);
  s.addText("THROMBOTIC", { x: 0.3, y: 3.45, w: 2.0, h: 0.38, fontSize: 10, bold: true, color: C.teal, align: "center", valign: "middle", margin: 0 });
  s.addText("Atherosclerotic plaque\nGradual onset\nWake-up stroke", { x: 0.3, y: 3.85, w: 2.0, h: 1.05, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 4 });

  // Sub: Embolic
  arrowDown(s, 2.65, 3.0, 0.3, 0.4, C.teal);
  card(s, 2.3, 3.45, 2.0, 1.5, C.cardBg);
  s.addText("EMBOLIC", { x: 2.3, y: 3.45, w: 2.0, h: 0.38, fontSize: 10, bold: true, color: C.teal, align: "center", valign: "middle", margin: 0 });
  s.addText("From heart (Afib #1)\nSudden onset\nMiddle cerebral art.", { x: 2.3, y: 3.85, w: 2.0, h: 1.05, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 4 });

  // Hemorrhagic branch (right)
  arrowDown(s, 10.0, 1.7, 0.3, 0.45, C.red);
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 8.8, y: 2.2, w: 3.5, h: 0.7, fill: { color: "#7F1D1D" }, line: { color: C.red }, rectRadius: 0.07 });
  s.addText("HEMORRHAGIC  (13%)", { x: 8.8, y: 2.2, w: 3.5, h: 0.7, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // Sub: ICH
  arrowDown(s, 9.1, 3.0, 0.3, 0.4, C.red);
  card(s, 8.3, 3.45, 2.0, 1.5, C.cardBg);
  s.addText("INTRACEREBRAL", { x: 8.3, y: 3.45, w: 2.0, h: 0.38, fontSize: 9, bold: true, color: C.red, align: "center", valign: "middle", margin: 0 });
  s.addText("HTN #1 cause\nCharcot-Bouchard\naneurysms\nPutamen most common", { x: 8.3, y: 3.85, w: 2.0, h: 1.05, fontSize: 8, color: C.offWhite, valign: "top", margin: 4 });

  // Sub: SAH
  arrowDown(s, 10.65, 3.0, 0.3, 0.4, C.red);
  card(s, 10.0, 3.45, 2.2, 1.5, C.cardBg);
  s.addText("SUBARACHNOID", { x: 10.0, y: 3.45, w: 2.2, h: 0.38, fontSize: 9, bold: true, color: C.red, align: "center", valign: "middle", margin: 0 });
  s.addText("Berry aneurysm #1\n'Worst HA of life'\nXanthochromia CSF\nADPKD association", { x: 10.0, y: 3.85, w: 2.2, h: 1.05, fontSize: 8, color: C.offWhite, valign: "top", margin: 4 });

  // EDH vs SDH comparison
  s.addText("EDH vs SDH", { x: 4.4, y: 5.15, w: 4.5, h: 0.4, fontSize: 13, bold: true, color: C.orange, align: "center" });
  const edhSdh = [
    ["", "EPIDURAL (EDH)", "SUBDURAL (SDH)"],
    ["Vessel", "Middle meningeal ARTERY", "Bridging VEINS"],
    ["CT shape", "Biconvex (lens-shaped)", "Crescent-shaped"],
    ["Lucid interval", "YES (classic)", "Sometimes"],
    ["Cause", "Temporal bone fracture", "Elderly / alcoholics"],
    ["Speed", "Fast (arterial)", "Slow (venous)"],
  ];
  const eCols = [1.3, 4.2, 3.9];
  const eX = [4.1, 5.45, 8.4];
  edhSdh.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const bg = ri === 0 ? C.orange : (ri % 2 === 0 ? C.cardBg : C.cardBg2);
      const fg = ri === 0 ? C.navy : (ci === 0 ? C.gray : C.offWhite);
      s.addShape(pres.shapes.RECTANGLE, { x: eX[ci], y: 5.58 + ri * 0.32, w: eCols[ci], h: 0.3, fill: { color: bg }, line: { color: C.orange, transparency: 60 } });
      s.addText(cell, { x: eX[ci] + 0.05, y: 5.58 + ri * 0.32, w: eCols[ci] - 0.1, h: 0.3, fontSize: 8.5, bold: ri === 0, color: fg, valign: "middle", margin: 0 });
    });
  });
  s.addText("Mnemonic: EDH = ARTERY = FAST  |  SDH = VEIN = SLOW", { x: 4.1, y: 7.1, w: 9.0, h: 0.3, fontSize: 10, bold: true, color: C.orange, align: "center", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 β€” NEURODEGENERATION
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "04 | Neurodegenerative Diseases β€” The Big 4", C.green);

  const diseases = [
    {
      name: "ALZHEIMER'S",
      mnemonic: "ABCs of Alzheimer's",
      color: C.teal,
      points: ["A - Amyloid-Ξ² plaques (extracellular)","B - Brain atrophy (hippocampus 1st)","C - Chromosome 21 / ApoE4","D - Downreg. ACh","E - Early = short-term memory loss","F - Fibrillary tangles (tau, intracell.)","Rx: Donepezil (AChEI)"],
    },
    {
      name: "PARKINSON'S",
      mnemonic: "TRAP",
      color: C.purple,
      points: ["T - Tremor (resting, pill-rolling)","R - Rigidity (cogwheel)","A - Akinesia/bradykinesia","P - Postural instability","Path: Lewy bodies (Ξ±-synuclein)","Location: Substantia Nigra","Rx: Levodopa/Carbidopa (gold std)"],
    },
    {
      name: "ALS",
      mnemonic: "All Limbs, Spared Sensation",
      color: C.orange,
      points: ["UMN + LMN both involved","NO sensory loss","NO cognitive decline","NO autonomic dysfunction","Gene: SOD1 mutation","Progressive respiratory failure","Rx: Riluzole (only disease-modifying)"],
    },
    {
      name: "LEWY BODY",
      mnemonic: "VIPs Fluctuate",
      color: C.red,
      points: ["V - Visual hallucinations (early)","I - Identity: Parkinsonism early","P - Psychiatric (REM sleep disorder)","Fluctuating cognition","Lewy bodies (Ξ±-synuclein)","Sensitive to antipsychotics","Rx: Rivastigmine"],
    },
  ];
  diseases.forEach((d, i) => {
    const x = 0.2 + i * 3.27;
    card(s, x, 1.0, 3.05, 6.35, C.cardBg);
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.0, w: 3.05, h: 0.48, fill: { color: d.color }, line: { color: d.color } });
    s.addText(d.name, { x: x + 0.05, y: 1.0, w: 2.95, h: 0.48, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: x + 0.1, y: 1.55, w: 2.85, h: 0.35, fill: { color: d.color, transparency: 50 }, line: { color: d.color, transparency: 30 }, rectRadius: 0.05 });
    s.addText(d.mnemonic, { x: x + 0.1, y: 1.55, w: 2.85, h: 0.35, fontSize: 9, bold: true, italic: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    d.points.forEach((p, pi) => {
      s.addText("β€’ " + p, { x: x + 0.12, y: 2.02 + pi * 0.73, w: 2.85, h: 0.65, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 0 });
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 β€” CNS INFECTIONS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "05 | CNS Infections β€” Meningitis, Encephalitis, Prions", C.orange);

  // CSF Table
  s.addText("CSF Analysis Quick Comparison", { x: 0.2, y: 1.0, w: 12.9, h: 0.4, fontSize: 14, bold: true, color: C.orange });
  const csfH = ["Feature", "BACTERIAL", "VIRAL (Aseptic)", "FUNGAL / TB"];
  const csfR = [
    ["Appearance", "Turbid / Cloudy", "Clear", "Clear or Turbid"],
    ["WBC", "High PMNs (>1000)", "High Lymphocytes", "High Lymphocytes"],
    ["Glucose", "VERY LOW (<40)", "Normal", "Low"],
    ["Protein", "VERY HIGH (>200)", "Slightly High", "High"],
    ["Opening Pressure", "Elevated", "Normal/slightly elevated", "Elevated"],
  ];
  const csfCW = [2.1, 2.9, 3.0, 3.0];
  const csfCX = [0.2, 2.35, 5.3, 8.35];
  const csfHC = [C.cardBg, C.red, C.tealDk, C.purple];
  csfH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: csfCX[ci], y: 1.45, w: csfCW[ci], h: 0.42, fill: { color: csfHC[ci] }, line: { color: csfHC[ci] } });
    s.addText(h, { x: csfCX[ci] + 0.05, y: 1.45, w: csfCW[ci] - 0.1, h: 0.42, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0, align: ci > 0 ? "center" : "left" });
  });
  csfR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: csfCX[ci], y: 1.9 + ri * 0.42, w: csfCW[ci], h: 0.4, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.gray, transparency: 80 } });
      s.addText(cell, { x: csfCX[ci] + 0.05, y: 1.9 + ri * 0.42, w: csfCW[ci] - 0.1, h: 0.4, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0, align: ci > 0 ? "center" : "left" });
    });
  });

  // Bugs by age
  s.addText("Bacterial Meningitis Bugs by Age Group", { x: 0.2, y: 4.15, w: 6.5, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const ages = [
    { age: "0-3 months", bugs: "GBS, E. coli, Listeria", memo: "GEL", color: C.red },
    { age: "3m - 18 yrs", bugs: "N. meningitidis, S. pneumoniae, H. influenzae", memo: "NMSH", color: C.orange },
    { age: "Adults 18-50", bugs: "S. pneumoniae, N. meningitidis", memo: "SN", color: C.teal },
    { age: "Elderly / Immunocomp.", bugs: "S. pneumoniae, Listeria", memo: "SPL", color: C.purple },
  ];
  ages.forEach((a, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 4.6 + i * 0.7, w: 1.8, h: 0.55, fill: { color: a.color }, line: { color: a.color }, rectRadius: 0.06 });
    s.addText(a.age, { x: 0.2, y: 4.6 + i * 0.7, w: 1.8, h: 0.55, fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(a.bugs, { x: 2.1, y: 4.6 + i * 0.7, w: 4.1, h: 0.55, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    pill(s, "Memo: " + a.memo, 6.3, 4.65 + i * 0.7, 1.4, 0.38, a.color);
  });

  // Right side: HSV & Crypto
  card(s, 8.0, 4.1, 5.1, 1.6, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 8.0, y: 4.1, w: 5.1, h: 0.38, fill: { color: C.red, transparency: 20 }, line: { color: C.red } });
  s.addText("HSV Encephalitis", { x: 8.05, y: 4.1, w: 5.0, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  s.addText("Temporal lobe | Fever + personality change + seizures\nCSF: PCR for HSV DNA | Treatment: IV ACYCLOVIR (STAT!)", { x: 8.05, y: 4.52, w: 5.0, h: 1.1, fontSize: 9, color: C.offWhite, valign: "top", margin: 0 });

  card(s, 8.0, 5.85, 5.1, 1.55, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 8.0, y: 5.85, w: 5.1, h: 0.38, fill: { color: C.purple, transparency: 20 }, line: { color: C.purple } });
  s.addText("Cryptococcal Meningitis + CJD (Prion)", { x: 8.05, y: 5.85, w: 5.0, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
  s.addText("Crypto: HIV (CD4<100) | India Ink halo | Rx: Ampho B + 5-FC\nCJD: Spongiform vacuolation | Myoclonus + rapid dementia", { x: 8.05, y: 6.27, w: 5.0, h: 1.05, fontSize: 9, color: C.offWhite, valign: "top", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 β€” ENDOCRINE SECTION INTRO
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "0A1628" };
  s.addShape(pres.shapes.RECTANGLE, { x: 13.0, y: 0, w: 0.3, h: 7.5, fill: { color: C.green }, line: { color: C.green } });
  s.addText("SECTION 2", { x: 0.6, y: 0.5, w: 12, h: 0.5, fontSize: 14, bold: true, color: C.green, charSpacing: 4 });
  s.addText("Endocrine\nPathology", { x: 0.6, y: 1.1, w: 12, h: 2.2, fontSize: 52, bold: true, color: C.white, fontFace: "Calibri" });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.4, w: 4, h: 0.05, fill: { color: C.green }, line: { color: C.green } });
  const topics = [
    { label: "01", text: "Pituitary Disorders", color: C.teal },
    { label: "02", text: "Thyroid Disorders", color: C.green },
    { label: "03", text: "Adrenal Disorders", color: C.orange },
    { label: "04", text: "Diabetes Mellitus", color: C.red },
  ];
  topics.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.7 + i * 0.78, w: 0.45, h: 0.48, fill: { color: t.color }, line: { color: t.color } });
    s.addText(t.label, { x: 0.6, y: 3.7 + i * 0.78, w: 0.45, h: 0.48, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(t.text, { x: 1.2, y: 3.75 + i * 0.78, w: 9, h: 0.4, fontSize: 18, color: C.white, valign: "middle", margin: 0 });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 β€” PITUITARY
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 01 | Pituitary Disorders β€” Hormones & Adenomas", C.teal);

  // FLAT PiG
  s.addText("Anterior Pituitary β€” Mnemonic: FLAT PiG", { x: 0.2, y: 1.0, w: 7.5, h: 0.38, fontSize: 13, bold: true, color: C.teal });
  const hormones = [
    { letter: "F", h: "FSH", note: "Follicle stimulating" },
    { letter: "L", h: "LH", note: "Luteinizing hormone" },
    { letter: "A", h: "ACTH", note: "Adrenocorticotropic" },
    { letter: "T", h: "TSH", note: "Thyroid stimulating" },
    { letter: "Pi", h: "PRL", note: "Prolactin" },
    { letter: "G", h: "GH", note: "Growth hormone" },
  ];
  hormones.forEach((h, i) => {
    const x = 0.2 + i * 2.15;
    s.addShape(pres.shapes.ELLIPSE, { x, y: 1.5, w: 1.8, h: 0.8, fill: { color: C.tealDk, transparency: 20 }, line: { color: C.teal } });
    s.addText(h.letter, { x, y: 1.5, w: 0.55, h: 0.8, fontSize: 18, bold: true, color: C.accent, align: "center", valign: "middle", margin: 0 });
    s.addText(h.h + "\n" + h.note, { x: x + 0.5, y: 1.5, w: 1.3, h: 0.8, fontSize: 8, color: C.white, valign: "middle", margin: 0 });
  });
  s.addText("Posterior: ADH + Oxytocin (made in hypothalamus, stored in posterior pituitary)", { x: 0.2, y: 2.4, w: 12.9, h: 0.35, fontSize: 10, italic: true, color: C.gray });

  // Adenoma table
  s.addText("Pituitary Adenoma Types", { x: 0.2, y: 2.85, w: 7.5, h: 0.38, fontSize: 13, bold: true, color: C.teal });
  const adH = ["Adenoma", "Hormone", "Presentation"];
  const adR = [
    ["Prolactinoma (#1)", "Prolactin", "Amenorrhea + galactorrhea (F); Impotence (M) | Rx: Cabergoline"],
    ["Somatotroph", "GH", "Acromegaly (adult) / Gigantism (child) | Rx: Transsphenoidal surgery"],
    ["Corticotroph", "ACTH", "Cushing's DISEASE | Suppressed by high-dose dexamethasone"],
    ["Non-functioning", "None", "Mass effects: Bitemporal hemianopia (optic chiasm compression)"],
  ];
  const adCW = [2.4, 1.8, 8.7];
  const adCX = [0.2, 2.65, 4.5];
  adH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: adCX[ci], y: 3.28, w: adCW[ci], h: 0.38, fill: { color: C.tealDk }, line: { color: C.tealDk } });
    s.addText(h, { x: adCX[ci] + 0.05, y: 3.28, w: adCW[ci] - 0.1, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
  });
  adR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: adCX[ci], y: 3.7 + ri * 0.55, w: adCW[ci], h: 0.52, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.teal, transparency: 70 } });
      s.addText(cell, { x: adCX[ci] + 0.05, y: 3.7 + ri * 0.55, w: adCW[ci] - 0.1, h: 0.52, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  // DI flowchart
  s.addText("Diabetes Insipidus Flowchart", { x: 0.2, y: 5.95, w: 12.9, h: 0.38, fontSize: 13, bold: true, color: C.accent });
  // DI node
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 5.0, y: 6.38, w: 3.3, h: 0.55, fill: { color: C.tealDk }, line: { color: C.teal }, rectRadius: 0.07 });
  s.addText("DIABETES INSIPIDUS\n(Dilute urine, high serum Na)", { x: 5.0, y: 6.38, w: 3.3, h: 0.55, fontSize: 8.5, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
  // Branches
  arrowDown(s, 5.45, 7.0, 0.3, 0.35, C.teal);
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 3.8, y: 7.0, w: 2.6, h: 0.38, fill: { color: C.teal, transparency: 25 }, line: { color: C.teal }, rectRadius: 0.06 });
  s.addText("CENTRAL DI  (ADH deficient)\nRx: Desmopressin", { x: 3.8, y: 7.0, w: 2.6, h: 0.38, fontSize: 8, color: C.white, align: "center", valign: "middle", margin: 0 });
  arrowDown(s, 7.55, 7.0, 0.3, 0.35, C.purple);
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 7.1, y: 7.0, w: 2.6, h: 0.38, fill: { color: C.purple, transparency: 25 }, line: { color: C.purple }, rectRadius: 0.06 });
  s.addText("NEPHROGENIC DI (ADH resistant)\nRx: Thiazides + Low Na diet", { x: 7.1, y: 7.0, w: 2.6, h: 0.38, fontSize: 8, color: C.white, align: "center", valign: "middle", margin: 0 });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 β€” THYROID
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 02 | Thyroid Disorders β€” Hypo vs Hyper + Cancer", C.green);

  // Hypo card
  card(s, 0.2, 1.0, 6.15, 3.4, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.0, w: 6.15, h: 0.45, fill: { color: "#1B4332" }, line: { color: C.green } });
  s.addText("HYPOTHYROIDISM  β€” Mnemonic: SLOW BM", { x: 0.3, y: 1.0, w: 6.0, h: 0.45, fontSize: 12, bold: true, color: C.green, valign: "middle", margin: 0 });
  const hypo = [
    ["S", "Sensitivity to cold"],
    ["L", "Lethargy + depression"],
    ["O", "Obesity (weight gain)"],
    ["W", "Water retention (myxedema)"],
    ["B", "Bradycardia"],
    ["M", "Menorrhagia + constipation"],
  ];
  hypo.forEach(([l, v], i) => {
    const col = i % 2, row = Math.floor(i / 2);
    s.addShape(pres.shapes.ELLIPSE, { x: 0.3 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fill: { color: C.green }, line: { color: C.green } });
    s.addText(l, { x: 0.3 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 0.75 + col * 3.0, y: 1.55 + row * 0.65, w: 2.6, h: 0.35, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Cause #1 (West): Hashimoto's (anti-TPO, anti-Tg) | Rx: Levothyroxine", { x: 0.3, y: 3.6, w: 5.9, h: 0.38, fontSize: 8.5, italic: true, color: C.gray, valign: "middle", margin: 0 });

  // Hyper card
  card(s, 6.95, 1.0, 6.15, 3.4, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 6.95, y: 1.0, w: 6.15, h: 0.45, fill: { color: "#1C3D2B" }, line: { color: C.teal } });
  s.addText("HYPERTHYROIDISM  β€” Mnemonic: FAST THY", { x: 7.05, y: 1.0, w: 6.0, h: 0.45, fontSize: 12, bold: true, color: C.teal, valign: "middle", margin: 0 });
  const hyper = [
    ["F", "Flushing, heat intolerance"],
    ["A", "Arrhythmia (Afib), anxiety"],
    ["S", "Skinny (wt loss, diarrhea)"],
    ["T", "Tremor + tachycardia"],
    ["T", "Thyroid goiter"],
    ["HY", "High T3/T4, young women"],
  ];
  hyper.forEach(([l, v], i) => {
    const col = i % 2, row = Math.floor(i / 2);
    s.addShape(pres.shapes.ELLIPSE, { x: 7.05 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fill: { color: C.teal }, line: { color: C.teal } });
    s.addText(l, { x: 7.05 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 7.5 + col * 3.0, y: 1.55 + row * 0.65, w: 2.6, h: 0.35, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Graves' triad: Hyperthyroid + Exophthalmos + Pretibial myxedema | Rx: PTU (pregnancy), I-131, Beta-blocker", { x: 7.05, y: 3.6, w: 5.9, h: 0.38, fontSize: 8.5, italic: true, color: C.gray, valign: "middle", margin: 0 });

  // Thyroid cancer
  s.addText("Thyroid Cancer β€” PaFoMeAn (Best to Worst Prognosis)", { x: 0.2, y: 4.55, w: 12.9, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const cancers = [
    { name: "PAPILLARY", pct: "80%", color: C.green, key: "Orphan Annie nuclei\nPsammoma bodies\nRET/PTC mutation\nCervical LN mets (still good Px)" },
    { name: "FOLLICULAR", pct: "10%", color: C.teal, key: "Hematogenous spread\nVascular invasion\nNo lymph node mets\nRAI responsive" },
    { name: "MEDULLARY", pct: "5-8%", color: C.orange, key: "C-cells β†’ Calcitonin\nAmyloid stroma\nRET mutation\nMEN2A/2B" },
    { name: "ANAPLASTIC", pct: "<5%", color: C.red, key: "Elderly patients\nRapidly fatal\nNO response to RAI\nWorst prognosis" },
  ];
  cancers.forEach((c, i) => {
    const x = 0.2 + i * 3.27;
    card(s, x, 5.0, 3.05, 2.3, C.cardBg);
    s.addShape(pres.shapes.RECTANGLE, { x, y: 5.0, w: 3.05, h: 0.4, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.name + "  " + c.pct, { x: x + 0.05, y: 5.0, w: 2.95, h: 0.4, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addText(c.key, { x: x + 0.1, y: 5.45, w: 2.85, h: 1.8, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 0 });
  });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 7.28, w: 12.9, h: 0.15, fill: { color: C.green }, line: { color: C.green } });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 β€” ADRENAL
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 03 | Adrenal Disorders β€” GFR Zones + Cushing/Addison/Pheo", C.orange);

  // GFR zones diagram
  s.addText("Adrenal Zones β€” Mnemonic: GFR (outside β†’ in)", { x: 0.2, y: 1.0, w: 6.5, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const zones = [
    { name: "GLOMERULOSA", makes: "Aldosterone", color: C.teal, x: 0.2, w: 4.2 },
    { name: "FASCICULATA", makes: "Cortisol (longest zone)", color: C.orange, x: 0.2, w: 3.2 },
    { name: "RETICULARIS", makes: "Androgens (DHEA)", color: C.purple, x: 0.2, w: 2.2 },
    { name: "MEDULLA", makes: "Catecholamines (Epi >> NE)", color: C.red, x: 0.2, w: 1.4 },
  ];
  zones.forEach((z, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.5 + i * 0.62, w: z.w + 1.5, h: 0.55, fill: { color: z.color, transparency: 30 }, line: { color: z.color } });
    s.addText(z.name + ": " + z.makes, { x: 0.3, y: 1.5 + i * 0.62, w: z.w + 1.3, h: 0.55, fontSize: 9.5, bold: true, color: C.white, valign: "middle", margin: 0 });
  });
  s.addText("'Go Find Rex' β€” and Rex lives in the Medulla", { x: 0.2, y: 4.05, w: 5.5, h: 0.35, fontSize: 9, italic: true, color: C.gray });

  // Cushing's
  card(s, 6.0, 1.0, 7.1, 3.0, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 6.0, y: 1.0, w: 7.1, h: 0.4, fill: { color: C.orange, transparency: 20 }, line: { color: C.orange } });
  s.addText("Cushing's Syndrome β€” Mnemonic: CUSHINGS", { x: 6.1, y: 1.0, w: 6.9, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  const cush = ["C - Central obesity (moon face, buffalo hump)", "U - Urine cortisol elevated", "S - Striae (purple)", "H - Hypertension", "I - Insulin resistance", "N - No menses (amenorrhea)", "G - Glucose elevated", "S - Skin thinning + easy bruising"];
  cush.forEach((c, i) => {
    const col = i % 2, row = Math.floor(i / 2);
    s.addText("β€’ " + c, { x: 6.1 + col * 3.5, y: 1.5 + row * 0.48, w: 3.4, h: 0.42, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Dx Test: High-dose Dex suppresses PITUITARY only (not ectopic ACTH, not adrenal)", { x: 6.1, y: 3.62, w: 6.9, h: 0.35, fontSize: 8.5, italic: true, color: C.gray, margin: 0 });

  // Addison's
  card(s, 0.2, 4.45, 4.3, 2.75, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 4.45, w: 4.3, h: 0.4, fill: { color: C.teal, transparency: 20 }, line: { color: C.teal } });
  s.addText("Addison's β€” SHADE", { x: 0.3, y: 4.45, w: 4.1, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  ["S - Skin hyperpigmentation (ACTH→MSH)", "H - Hypotension + Hyperkalemia", "A - Anemia", "D - Dehydration (Na wasting)", "E - Electrolytes: Low Na, High K"].forEach((p, i) => {
    s.addText("β€’ " + p, { x: 0.3, y: 4.95 + i * 0.43, w: 4.0, h: 0.38, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Rx: IV Hydrocortisone + IV Saline (Addisonian crisis)", { x: 0.3, y: 7.0, w: 4.0, h: 0.35, fontSize: 8, italic: true, color: C.gray });

  // Conn's
  card(s, 4.7, 4.45, 4.1, 2.75, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 4.7, y: 4.45, w: 4.1, h: 0.4, fill: { color: C.green, transparency: 20 }, line: { color: C.green } });
  s.addText("Conn's β€” HANK", { x: 4.8, y: 4.45, w: 3.9, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  ["H - Hypertension (resistant)", "A - Alkalosis (metabolic)", "N - No renin (low renin)", "K - K+ low (hypokalemia)"].forEach((p, i) => {
    s.addText("β€’ " + p, { x: 4.8, y: 4.95 + i * 0.52, w: 3.85, h: 0.48, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Cause: Adrenal adenoma | Rx: Spironolactone", { x: 4.8, y: 7.0, w: 3.85, h: 0.35, fontSize: 8, italic: true, color: C.gray });

  // Pheo
  card(s, 9.0, 4.45, 4.1, 2.75, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 9.0, y: 4.45, w: 4.1, h: 0.4, fill: { color: C.red, transparency: 20 }, line: { color: C.red } });
  s.addText("Pheochromocytoma β€” 5 P's", { x: 9.1, y: 4.45, w: 3.9, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  ["P - Paroxysmal HTN", "P - Palpitations", "P - Perspiration (diaphoresis)", "P - Pallor", "P - Pain (headache)"].forEach((p, i) => {
    s.addText("β€’ " + p, { x: 9.1, y: 4.95 + i * 0.43, w: 3.85, h: 0.38, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Rule of 10s | Dx: Urine metanephrines | Rx: Alpha-block FIRST then Beta-block then surgery", { x: 9.1, y: 6.65, w: 3.85, h: 0.55, fontSize: 7.5, italic: true, color: C.gray });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 β€” DIABETES MELLITUS
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 04 | Diabetes Mellitus β€” T1 vs T2, DKA vs HHS, Drugs", C.red);

  // T1 vs T2 table
  s.addText("Type 1 vs Type 2 Diabetes", { x: 0.2, y: 1.0, w: 12.9, h: 0.38, fontSize: 13, bold: true, color: C.red });
  const dmH = ["Feature", "TYPE 1", "TYPE 2"];
  const dmR = [
    ["Pathology", "Autoimmune beta-cell destruction", "Insulin resistance + relative deficiency"],
    ["Age", "< 30 (child / young adult)", "> 40 (middle-aged / elderly)"],
    ["Body type", "Thin", "Obese"],
    ["Ketoacidosis", "YES β€” DKA (classic)", "Rare β€” HHS instead"],
    ["Autoantibodies", "Anti-GAD, Anti-islet cell", "None"],
    ["HLA link", "DR3, DR4", "No HLA link"],
    ["Treatment", "Insulin ONLY", "Lifestyle β†’ Metformin β†’ add-ons β†’ Insulin"],
  ];
  const dmCW = [2.2, 5.3, 5.5];
  const dmCX = [0.2, 2.45, 7.8];
  dmH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: dmCX[ci], y: 1.43, w: dmCW[ci], h: 0.38, fill: { color: ci === 1 ? C.tealDk : (ci === 2 ? "#7F1D1D" : C.cardBg) }, line: { color: C.red } });
    s.addText(h, { x: dmCX[ci] + 0.05, y: 1.43, w: dmCW[ci] - 0.1, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0, align: ci === 0 ? "left" : "center" });
  });
  dmR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: dmCX[ci], y: 1.85 + ri * 0.46, w: dmCW[ci], h: 0.44, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.red, transparency: 80 } });
      s.addText(cell, { x: dmCX[ci] + 0.05, y: 1.85 + ri * 0.46, w: dmCW[ci] - 0.1, h: 0.44, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  // DKA vs HHS
  s.addText("DKA vs HHS β€” Critical Comparison", { x: 0.2, y: 5.15, w: 7.0, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const dkaH = ["Feature", "DKA (Type 1)", "HHS (Type 2)"];
  const dkaR = [
    ["Glucose", "> 250 mg/dL", "> 600 mg/dL"],
    ["pH", "< 7.3 (ACIDOSIS)", "Normal (> 7.3)"],
    ["Ketones", "YES (+++)", "Minimal / absent"],
    ["Osmolality", "Mildly elevated", "> 320 mOsm/kg"],
    ["Mortality", "~1%", "~15% (worse!)"],
  ];
  const dkaCW = [2.0, 2.5, 2.5];
  const dkaCX = [0.2, 2.25, 4.8];
  dkaH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: dkaCX[ci], y: 5.57, w: dkaCW[ci], h: 0.38, fill: { color: ci === 1 ? C.tealDk : (ci === 2 ? "#7F1D1D" : C.cardBg) }, line: { color: C.orange } });
    s.addText(h, { x: dkaCX[ci] + 0.05, y: 5.57, w: dkaCW[ci] - 0.1, h: 0.38, fontSize: 9, bold: true, color: C.white, valign: "middle", margin: 0, align: ci === 0 ? "left" : "center" });
  });
  dkaR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: dkaCX[ci], y: 5.99 + ri * 0.42, w: dkaCW[ci], h: 0.4, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.orange, transparency: 70 } });
      s.addText(cell, { x: dkaCX[ci] + 0.05, y: 5.99 + ri * 0.42, w: dkaCW[ci] - 0.1, h: 0.4, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  // Oral drugs
  s.addText("Key Oral Antidiabetics", { x: 7.6, y: 5.15, w: 5.5, h: 0.38, fontSize: 13, bold: true, color: C.green });
  const drugs = [
    { name: "Metformin", memo: "#1 T2DM | No hypoglycemia | Lactic acidosis risk", color: C.green },
    { name: "Sulfonylureas", memo: "Stimulate insulin secretion | CAN cause hypoglycemia", color: C.orange },
    { name: "GLP-1 agonists", memo: "Weight loss | Used in obese T2DM", color: C.teal },
    { name: "SGLT2 inhibitors", memo: "Glucosuria | UTI risk | Cardioprotective", color: C.purple },
  ];
  drugs.forEach((d, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 7.6, y: 5.6 + i * 0.47, w: 2.0, h: 0.38, fill: { color: d.color }, line: { color: d.color }, rectRadius: 0.06 });
    s.addText(d.name, { x: 7.6, y: 5.6 + i * 0.47, w: 2.0, h: 0.38, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(d.memo, { x: 9.7, y: 5.6 + i * 0.47, w: 3.4, h: 0.38, fontSize: 8, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("CRAMPS Complications: Cardiovascular | Retinopathy | Atherosclerosis | Micro-albuminuria (nephropathy) | Peripheral neuropathy | Susceptibility to infection", { x: 7.6, y: 7.5, w: 5.5, h: 0.38, fontSize: 7.5, italic: true, color: C.gray });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 β€” ONE-LINE KILLERS / RAPID RECALL
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  sectionBar(s, "RAPID RECALL β€” One-Line Killers for MCQs", C.teal);

  const killers = [
    ["Periventricular lesions, young woman", "Multiple Sclerosis", C.teal],
    ["Ascending paralysis after Campylobacter", "GBS", C.teal],
    ["'Worst HA of my life'", "SAH (Berry aneurysm)", C.red],
    ["Xanthochromia in CSF", "Subarachnoid Hemorrhage", C.red],
    ["Temporal lobe + fever + personality change", "HSV Encephalitis β†’ ACYCLOVIR", C.orange],
    ["Pill-rolling tremor + cogwheel rigidity", "Parkinson's β€” Lewy bodies", C.purple],
    ["Beta-amyloid + neurofibrillary tangles", "Alzheimer's Disease", C.purple],
    ["Orphan Annie nuclei + Psammoma bodies", "Papillary Thyroid Cancer", C.green],
    ["Calcitonin-secreting tumor", "Medullary Thyroid Ca (MEN2)", C.green],
    ["High aldosterone + low renin + low K+", "Conn's Syndrome", C.orange],
    ["Paroxysmal HTN + diaphoresis + headache", "Pheochromocytoma", C.red],
    ["Skin hyperpigmentation + low Na + high K+", "Addison's Disease", C.teal],
    ["Moon face + buffalo hump + purple striae", "Cushing's Syndrome", C.orange],
    ["Bitemporal hemianopia", "Pituitary tumor (chiasm compression)", C.purple],
    ["High protein + normal WBC in CSF", "GBS (albuminocytologic dissociation)", C.teal],
    ["India Ink halo + HIV patient", "Cryptococcus meningitis", C.green],
    ["Spongiform vacuolation + myoclonus", "CJD (Prion disease)", C.red],
    ["Butterfly glioma crossing corpus callosum", "GBM (Grade IV)", C.purple],
    ["Homer-Wright rosettes, child, cerebellum", "Medulloblastoma", C.orange],
    ["Fried egg cells + 1p/19q deletion", "Oligodendroglioma", C.teal],
  ];
  // Two columns
  const left = killers.slice(0, 10);
  const right = killers.slice(10);
  [left, right].forEach((col, ci) => {
    col.forEach(([clue, ans, color], ri) => {
      const x = ci === 0 ? 0.2 : 6.75;
      const y = 1.0 + ri * 0.63;
      s.addShape(pres.shapes.RECTANGLE, { x, y, w: 6.4, h: 0.55, fill: { color: C.cardBg }, line: { color: color, transparency: 50 } });
      s.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.12, h: 0.55, fill: { color: color }, line: { color: color } });
      s.addText(clue, { x: x + 0.2, y, w: 3.8, h: 0.55, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
      s.addShape(pres.shapes.RIGHT_ARROW, { x: x + 4.05, y: y + 0.15, w: 0.3, h: 0.25, fill: { color: color }, line: { color: color } });
      s.addText(ans, { x: x + 4.45, y, w: 1.85, h: 0.55, fontSize: 8, bold: true, color: color, valign: "middle", margin: 0 });
    });
  });
}

// ═══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 β€” CLOSING
// ═══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.RECTANGLE, { x: 13.12, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("Good luck on your exams!", { x: 1.0, y: 1.2, w: 11.3, h: 1.2, fontSize: 42, bold: true, color: C.white, align: "center", fontFace: "Calibri" });
  s.addText("Master these mnemonics and you will ace your MCQs.", { x: 1.0, y: 2.5, w: 11.3, h: 0.6, fontSize: 20, color: C.teal, align: "center" });
  s.addShape(pres.shapes.RECTANGLE, { x: 3.5, y: 3.2, w: 6.3, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
  const mnems = [
    { label: "CNS", text: "SPASM (MS)  |  GAME (Tumors)  |  TRAP (Parkinson's)  |  ABCs (Alzheimer's)  |  CAME (Pediatric tumors)" },
    { label: "Endocrine", text: "FLAT PiG (Pituitary)  |  SLOW BM (Hypo)  |  FAST THY (Hyper)  |  PaFoMeAn (Thyroid Ca)" },
    { label: "Adrenal", text: "GFR zones  |  CUSHINGS  |  SHADE (Addison's)  |  HANK (Conn's)  |  5 P's + Rule of 10s (Pheo)" },
    { label: "Diabetes", text: "CRAMPS (complications)  |  RAIN (insulin types)  |  DKA vs HHS comparison" },
  ];
  mnems.forEach((m, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 1.0, y: 3.45 + i * 0.85, w: 1.6, h: 0.6, fill: { color: C.tealDk }, line: { color: C.teal }, rectRadius: 0.06 });
    s.addText(m.label, { x: 1.0, y: 3.45 + i * 0.85, w: 1.6, h: 0.6, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(m.text, { x: 2.75, y: 3.48 + i * 0.85, w: 10.0, h: 0.55, fontSize: 9.5, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Prepared by Orris β€” Your AI Study Companion", { x: 1.0, y: 7.0, w: 11.3, h: 0.35, fontSize: 10, color: C.gray, align: "center" });
}

// ═══ WRITE FILE ═══════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/med-study-pptx/CNS_Endocrine_HighYield.pptx" })
  .then(() => console.log("SUCCESS: Presentation written."))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/med-study-pptx && node build.js 2>&1

The issue is pres.shapes.RIGHT_ARROW and pres.shapes.DOWN_ARROW - these aren't valid. Let me check the valid shape names and fix:
Running Command

node -e "const p = require('pptxgenjs'); const ppt = new p(); console.log(Object.keys(ppt.shapes).filter(k => k.includes('ARROW')))"

Arrow shapes exist - the error is at line 76. That's the arrowRight helper. The issue must be the helper functions using pres.shapes before pres is defined at that call scope. Let me check - actually the arrowRight helper uses pres.shapes.RIGHT_ARROW which IS valid. The error is at line 76 which is in the Title slide. Let me check what's at line 76:
Reading File
The problem is line: { color: "000000", transparency: 100 } - the transparency property in a line object is not valid in pptxgenjs. I need to remove those invalid line transparency settings and use line: { color: "000000", width: 0 } or just omit the line. Also the line: { color: C.teal, transparency: 70 } patterns elsewhere need fixing. Let me fix all these issues at once:
Running Command

cd /home/daytona/workspace/med-study-pptx && sed -i 's/line: { color: "000000", transparency: 100 }/line: { color: "000000", width: 0 }/g' build.js && sed -i 's/line: { color: C\.teal, transparency: 70 }/line: { color: "1E293B", width: 0 }/g' build.js && sed -i 's/line: { color: C\.teal, transparency: 80 }/line: { color: "1E293B", width: 0 }/g' build.js && sed -i 's/line: { color: C\.orange, transparency: 70 }/line: { color: "1E293B", width: 0 }/g' build.js && sed -i 's/line: { color: C\.orange, transparency: 60 }/line: { color: C.orange, width: 1 }/g' build.js && sed -i 's/line: { color: C\.gray, transparency: 80 }/line: { color: "1E293B", width: 0 }/g' build.js && sed -i 's/line: { color: C\.red, transparency: 80 }/line: { color: "1E293B", width: 0 }/g' build.js && sed -i 's/line: { color: C\.purple, transparency: 30 }/line: { color: C.purple, width: 1 }/g' build.js && node build.js 2>&1

Sed can't do in-place on this filesystem. I'll rewrite the file with all fixes applied directly:
Writing File

~/med-study-pptx/build.js

const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "CNS & Endocrine Pathology - High Yield MCQ Study Guide";

const C = {
  navy:    "0D1B2A",
  darkBg:  "111827",
  teal:    "0EA5E9",
  tealDk:  "0369A1",
  green:   "10B981",
  red:     "EF4444",
  orange:  "F59E0B",
  purple:  "8B5CF6",
  white:   "FFFFFF",
  offWhite:"F1F5F9",
  gray:    "94A3B8",
  lightGray:"E2E8F0",
  cardBg:  "1E293B",
  cardBg2: "162032",
  accent:  "38BDF8",
};

function darkSlide(s) { s.background = { color: C.darkBg }; }

function sectionBar(s, title, color) {
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.85, fill: { color: color || C.tealDk }, line: { color: color || C.tealDk } });
  s.addText(title, { x: 0.2, y: 0, w: 12.9, h: 0.85, fontSize: 20, bold: true, color: C.white, valign: "middle", margin: 0 });
}

function card(s, x, y, w, h, fillColor) {
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w, h,
    fill: { color: fillColor || C.cardBg },
    line: { color: C.teal, width: 1 },
    rectRadius: 0.08,
    shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.25 }
  });
}

function pill(s, text, x, y, w, h, bg) {
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x, y, w, h, fill: { color: bg || C.teal }, line: { color: bg || C.teal }, rectRadius: 0.12 });
  s.addText(text, { x, y, w, h, fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
}

// ═══ SLIDE 1 β€” TITLE ═══════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 13.3, h: 0.18, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 7.32, w: 13.3, h: 0.18, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.ELLIPSE, { x: 9.5, y: 0.8, w: 3.5, h: 3.5, fill: { color: C.tealDk, transparency: 75 }, line: { color: C.tealDk, width: 0 } });
  s.addShape(pres.shapes.ELLIPSE, { x: 10.5, y: 3.5, w: 2.5, h: 2.5, fill: { color: C.purple, transparency: 80 }, line: { color: C.purple, width: 0 } });
  s.addText("CNS & Endocrine Pathology", { x: 0.5, y: 1.5, w: 9.5, h: 1.3, fontSize: 42, bold: true, color: C.white, fontFace: "Calibri" });
  s.addText("High-Yield MCQ Study Guide", { x: 0.5, y: 2.85, w: 9.5, h: 0.8, fontSize: 26, color: C.teal, fontFace: "Calibri" });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.75, w: 5.2, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("1st Year Preclinical  |  MCQ-Focused  |  Mnemonics & Flowcharts", { x: 0.5, y: 3.9, w: 9.5, h: 0.5, fontSize: 14, color: C.gray, fontFace: "Calibri" });
  const topics = ["CNS Demyelinating","Brain Tumors","Cerebrovascular","Neurodegeneration","CNS Infections","Pituitary","Thyroid","Adrenal","Diabetes"];
  const pillColors = [C.tealDk, C.purple, C.red, C.green, C.orange, C.teal, C.tealDk, C.purple, C.green];
  topics.forEach((t, i) => {
    const col = i % 5, row = Math.floor(i / 5);
    pill(s, t, 0.5 + col * 2.5, 4.7 + row * 0.55, 2.3, 0.38, pillColors[i]);
  });
}

// ═══ SLIDE 2 β€” CNS SECTION INTRO ══════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.3, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("SECTION 1", { x: 0.6, y: 0.5, w: 12, h: 0.5, fontSize: 14, bold: true, color: C.teal, charSpacing: 4 });
  s.addText("Central Nervous System\nPathology", { x: 0.6, y: 1.1, w: 12, h: 2, fontSize: 44, bold: true, color: C.white, fontFace: "Calibri" });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.2, w: 4, h: 0.05, fill: { color: C.teal }, line: { color: C.teal } });
  const topics = [
    { label: "01", text: "Demyelinating Diseases (MS, GBS)", color: C.teal },
    { label: "02", text: "Brain Tumors", color: C.purple },
    { label: "03", text: "Cerebrovascular Disease", color: C.red },
    { label: "04", text: "Neurodegeneration", color: C.green },
    { label: "05", text: "CNS Infections", color: C.orange },
  ];
  topics.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.5 + i * 0.7, w: 0.45, h: 0.45, fill: { color: t.color }, line: { color: t.color } });
    s.addText(t.label, { x: 0.6, y: 3.5 + i * 0.7, w: 0.45, h: 0.45, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(t.text, { x: 1.2, y: 3.52 + i * 0.7, w: 8, h: 0.4, fontSize: 16, color: C.white, valign: "middle", margin: 0 });
  });
}

// ═══ SLIDE 3 β€” MS vs GBS ══════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "01 | Demyelinating Diseases: Multiple Sclerosis vs Guillain-Barre Syndrome", C.tealDk);

  card(s, 0.2, 1.0, 6.2, 6.1, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.0, w: 6.2, h: 0.5, fill: { color: C.tealDk }, line: { color: C.tealDk } });
  s.addText("MULTIPLE SCLEROSIS (MS)", { x: 0.3, y: 1.0, w: 6.0, h: 0.5, fontSize: 13, bold: true, color: C.white, valign: "middle", margin: 0 });
  const msData = [
    ["Mnemonic", "SPASM:\nSensory, Pain, Ataxia, Sphincter, Motor"],
    ["Age/Sex", "Young women 20-40"],
    ["Pathology", "Oligodendrocyte destruction\nWhite matter demyelination"],
    ["Location", "Periventricular plaques\nDawson's Fingers on MRI"],
    ["CSF", "Oligoclonal IgG bands"],
    ["Signs", "Uhthoff's (heat worsens)\nLhermitte's (neck flex = shock)"],
    ["Treatment", "Beta-interferon (modify)\nSteroids (acute attack)"],
  ];
  msData.forEach(([k, v], i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 1.62 + i * 0.65, w: 1.6, h: 0.58, fill: { color: C.tealDk, transparency: 30 }, line: { color: C.teal, width: 1 } });
    s.addText(k, { x: 0.3, y: 1.62 + i * 0.65, w: 1.6, h: 0.58, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 2.05, y: 1.62 + i * 0.65, w: 4.25, h: 0.58, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });

  card(s, 6.9, 1.0, 6.2, 6.1, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 6.9, y: 1.0, w: 6.2, h: 0.5, fill: { color: C.purple }, line: { color: C.purple } });
  s.addText("GUILLAIN-BARRE SYNDROME (GBS)", { x: 7.0, y: 1.0, w: 6.0, h: 0.5, fontSize: 13, bold: true, color: C.white, valign: "middle", margin: 0 });
  const gbsData = [
    ["Mnemonic", "Goes Bottom-to-Shoulder\n= Ascending paralysis"],
    ["Trigger", "Post-infection\nCampylobacter jejuni #1"],
    ["Pathology", "Schwann cell destruction\nPeripheral demyelination"],
    ["Presentation", "Ascending flaccid paralysis\n+ Areflexia"],
    ["CSF", "ALBUMINOCYTOLOGIC\nDISSOCIATION\n(High protein, normal WBC)"],
    ["Risk", "Respiratory failure\nMonitor FVC!"],
    ["Treatment", "IVIG or Plasmapheresis"],
  ];
  gbsData.forEach(([k, v], i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 7.0, y: 1.62 + i * 0.65, w: 1.6, h: 0.58, fill: { color: C.purple, transparency: 30 }, line: { color: C.purple, width: 1 } });
    s.addText(k, { x: 7.0, y: 1.62 + i * 0.65, w: 1.6, h: 0.58, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 8.7, y: 1.62 + i * 0.65, w: 4.3, h: 0.58, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });

  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 7.1, w: 12.9, h: 0.38, fill: { color: C.red, transparency: 20 }, line: { color: C.red, width: 1 } });
  s.addText("MCQ TRAP:  MS = CENTRAL (UMN) = Spastic + Hyperreflexia     |     GBS = PERIPHERAL (LMN) = Flaccid + Areflexia", { x: 0.3, y: 7.1, w: 12.7, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
}

// ═══ SLIDE 4 β€” BRAIN TUMORS ════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "02 | Brain Tumors β€” High-Yield Table + Mnemonics (GAME / CAME)", C.purple);

  const game = [
    { letter: "G", text: "liomas (most common overall)", color: C.teal },
    { letter: "A", text: "denocarcinoma mets (#1 in adults)", color: C.orange },
    { letter: "M", text: "eningioma (most common BENIGN)", color: C.green },
    { letter: "E", text: "pendymoma (4th ventricle, child)", color: C.purple },
  ];
  game.forEach((g, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2 + i * 3.25, y: 1.0, w: 3.0, h: 0.85, fill: { color: g.color, transparency: 25 }, line: { color: g.color, width: 1 }, rectRadius: 0.07 });
    s.addText(g.letter, { x: 0.2 + i * 3.25, y: 1.0, w: 0.65, h: 0.85, fontSize: 26, bold: true, color: g.color, align: "center", valign: "middle", margin: 0 });
    s.addText(g.text, { x: 0.85 + i * 3.25, y: 1.0, w: 2.4, h: 0.85, fontSize: 10, color: C.white, valign: "middle", margin: 0 });
  });

  const headers = ["Tumor", "Location", "Age", "Key MCQ Fact"];
  const rows = [
    ["Pilocytic Astrocytoma", "Cerebellum", "Child", "Rosenthal fibers | BENIGN Grade I"],
    ["Medulloblastoma", "Cerebellum (4th V)", "Child", "Homer-Wright rosettes | Radiosensitive"],
    ["Ependymoma", "4th Ventricle", "Child", "Perivascular pseudorosettes"],
    ["GBM (Grade IV)", "Temporal/Frontal", "Elderly", "Butterfly pattern | Pseudopalisading necrosis | GFAP+"],
    ["Oligodendroglioma", "Frontal lobe", "Adult", "Fried egg cells | 1p/19q deletion"],
    ["Meningioma", "Parasagittal", "Adult F", "Psammoma bodies | Whorled pattern | BENIGN extra-axial"],
    ["Schwannoma (CN VIII)", "CPA angle", "Adult", "S100+ | Bilateral = NF2"],
    ["Craniopharyngioma", "Suprasellar", "Child", "Calcification | Cholesterol crystals | Bitemporal hemianopia"],
  ];
  const colW = [2.6, 2.2, 1.3, 6.8];
  const colX = [0.2, 2.85, 5.1, 6.45];
  headers.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: colX[ci], y: 2.0, w: colW[ci], h: 0.4, fill: { color: C.purple }, line: { color: C.purple } });
    s.addText(h, { x: colX[ci] + 0.05, y: 2.0, w: colW[ci] - 0.1, h: 0.4, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
  });
  rows.forEach((row, ri) => {
    const bg = ri % 2 === 0 ? C.cardBg : C.cardBg2;
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: colX[ci], y: 2.44 + ri * 0.6, w: colW[ci], h: 0.58, fill: { color: bg }, line: { color: C.cardBg, width: 0 } });
      s.addText(cell, { x: colX[ci] + 0.05, y: 2.44 + ri * 0.6, w: colW[ci] - 0.1, h: 0.58, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 7.1, w: 12.9, h: 0.35, fill: { color: C.orange, transparency: 25 }, line: { color: C.orange, width: 1 }, rectRadius: 0.05 });
  s.addText("PEDIATRIC (CAME):  Craniopharyngioma  |  Astrocytoma (pilocytic)  |  Medulloblastoma  |  Ependymoma", { x: 0.3, y: 7.1, w: 12.7, h: 0.35, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
}

// ═══ SLIDE 5 β€” STROKE FLOWCHART ════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "03 | Cerebrovascular Disease β€” Stroke Classification Flowchart", C.red);

  // Stroke central node
  s.addShape(pres.shapes.ELLIPSE, { x: 5.25, y: 1.05, w: 2.8, h: 0.9, fill: { color: C.red }, line: { color: C.red } });
  s.addText("STROKE", { x: 5.25, y: 1.05, w: 2.8, h: 0.9, fontSize: 18, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  // Ischemic branch
  s.addShape(pres.shapes.DOWN_ARROW, { x: 2.7, y: 1.6, w: 0.3, h: 0.45, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 1.0, y: 2.1, w: 3.5, h: 0.68, fill: { color: C.tealDk }, line: { color: C.teal, width: 1 }, rectRadius: 0.07 });
  s.addText("ISCHEMIC (87%)", { x: 1.0, y: 2.1, w: 3.5, h: 0.68, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.shapes.DOWN_ARROW, { x: 1.3, y: 2.85, w: 0.3, h: 0.4, fill: { color: C.teal }, line: { color: C.teal } });
  card(s, 0.3, 3.3, 2.0, 1.55, C.cardBg);
  s.addText("THROMBOTIC", { x: 0.3, y: 3.3, w: 2.0, h: 0.38, fontSize: 10, bold: true, color: C.teal, align: "center", valign: "middle", margin: 0 });
  s.addText("Atherosclerotic plaque\nGradual onset\nWake-up stroke", { x: 0.3, y: 3.7, w: 2.0, h: 1.1, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 4 });

  s.addShape(pres.shapes.DOWN_ARROW, { x: 2.65, y: 2.85, w: 0.3, h: 0.4, fill: { color: C.teal }, line: { color: C.teal } });
  card(s, 2.38, 3.3, 2.0, 1.55, C.cardBg);
  s.addText("EMBOLIC", { x: 2.38, y: 3.3, w: 2.0, h: 0.38, fontSize: 10, bold: true, color: C.teal, align: "center", valign: "middle", margin: 0 });
  s.addText("From heart (Afib #1)\nSudden onset\nMCA most common", { x: 2.38, y: 3.7, w: 2.0, h: 1.1, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 4 });

  // Hemorrhagic branch
  s.addShape(pres.shapes.DOWN_ARROW, { x: 10.0, y: 1.6, w: 0.3, h: 0.45, fill: { color: C.red }, line: { color: C.red } });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 8.8, y: 2.1, w: 3.5, h: 0.68, fill: { color: "7F1D1D" }, line: { color: C.red, width: 1 }, rectRadius: 0.07 });
  s.addText("HEMORRHAGIC (13%)", { x: 8.8, y: 2.1, w: 3.5, h: 0.68, fontSize: 14, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.shapes.DOWN_ARROW, { x: 9.1, y: 2.85, w: 0.3, h: 0.4, fill: { color: C.red }, line: { color: C.red } });
  card(s, 8.3, 3.3, 2.0, 1.55, C.cardBg);
  s.addText("INTRACEREBRAL", { x: 8.3, y: 3.3, w: 2.0, h: 0.38, fontSize: 9, bold: true, color: C.red, align: "center", valign: "middle", margin: 0 });
  s.addText("HTN #1 cause\nCharcot-Bouchard\naneurysms\nPutamen most common", { x: 8.3, y: 3.7, w: 2.0, h: 1.1, fontSize: 8, color: C.offWhite, valign: "top", margin: 4 });

  s.addShape(pres.shapes.DOWN_ARROW, { x: 10.65, y: 2.85, w: 0.3, h: 0.4, fill: { color: C.red }, line: { color: C.red } });
  card(s, 10.0, 3.3, 2.2, 1.55, C.cardBg);
  s.addText("SUBARACHNOID", { x: 10.0, y: 3.3, w: 2.2, h: 0.38, fontSize: 9, bold: true, color: C.red, align: "center", valign: "middle", margin: 0 });
  s.addText("Berry aneurysm #1\n'Worst HA of life'\nXanthochromia CSF\nADPKD association", { x: 10.0, y: 3.7, w: 2.2, h: 1.1, fontSize: 8, color: C.offWhite, valign: "top", margin: 4 });

  // EDH vs SDH table
  s.addText("EDH vs SDH Hematoma", { x: 4.4, y: 5.0, w: 4.5, h: 0.38, fontSize: 13, bold: true, color: C.orange, align: "center" });
  const edhSdh = [
    ["", "EPIDURAL (EDH)", "SUBDURAL (SDH)"],
    ["Vessel", "Middle meningeal ARTERY", "Bridging VEINS"],
    ["CT shape", "Biconvex (lens)", "Crescent-shaped"],
    ["Lucid interval", "YES (classic)", "Sometimes"],
    ["Cause", "Temporal bone fracture", "Elderly / alcoholics"],
  ];
  const eCols = [1.3, 4.0, 3.8];
  const eX = [4.2, 5.55, 9.6];
  edhSdh.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const bg = ri === 0 ? C.orange : (ri % 2 === 0 ? C.cardBg : C.cardBg2);
      const fg = ri === 0 ? C.navy : (ci === 0 ? C.gray : C.offWhite);
      s.addShape(pres.shapes.RECTANGLE, { x: eX[ci], y: 5.42 + ri * 0.35, w: eCols[ci], h: 0.33, fill: { color: bg }, line: { color: C.cardBg, width: 0 } });
      s.addText(cell, { x: eX[ci] + 0.05, y: 5.42 + ri * 0.35, w: eCols[ci] - 0.1, h: 0.33, fontSize: 9, bold: ri === 0, color: fg, valign: "middle", margin: 0 });
    });
  });
  s.addText("Mnemonic:  EDH = ARTERY = FAST  |  SDH = VEIN = SLOW", { x: 4.2, y: 7.15, w: 8.9, h: 0.3, fontSize: 10, bold: true, color: C.orange, align: "center", margin: 0 });
}

// ═══ SLIDE 6 β€” NEURODEGENERATION ══════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "04 | Neurodegenerative Diseases β€” The Big 4 (APAL)", C.green);

  const diseases = [
    {
      name: "ALZHEIMER'S",
      mnemonic: "ABCs of Alzheimer's",
      color: C.teal,
      points: ["A - Amyloid-Ξ² plaques (extracellular)","B - Brain atrophy (hippocampus 1st)","C - Chromosome 21 / ApoE4","D - Downreg. ACh (Rx: Donepezil)","E - Early = short-term memory loss","F - Fibrillary tangles (tau, intracell.)"],
    },
    {
      name: "PARKINSON'S",
      mnemonic: "TRAP",
      color: C.purple,
      points: ["T - Tremor (resting, pill-rolling)","R - Rigidity (cogwheel)","A - Akinesia / bradykinesia","P - Postural instability","Path: Lewy bodies (alpha-synuclein)","Location: Substantia Nigra","Rx: Levodopa/Carbidopa (gold std)"],
    },
    {
      name: "ALS",
      mnemonic: "All Limbs, Spared Sensation",
      color: C.orange,
      points: ["UMN + LMN both involved (unique)","NO sensory loss","NO cognitive decline","NO autonomic dysfunction","Gene: SOD1 mutation","Rx: Riluzole (only disease-modifying)"],
    },
    {
      name: "LEWY BODY",
      mnemonic: "VIPs Fluctuate",
      color: C.red,
      points: ["V - Visual hallucinations (EARLY)","I - Identity: Parkinsonism early","P - Psychiatric (REM sleep disorder)","Fluctuating cognition (hallmark)","Lewy bodies (alpha-synuclein)","Sensitive to antipsychotics!"],
    },
  ];
  diseases.forEach((d, i) => {
    const x = 0.2 + i * 3.27;
    card(s, x, 1.0, 3.05, 6.35, C.cardBg);
    s.addShape(pres.shapes.RECTANGLE, { x, y: 1.0, w: 3.05, h: 0.48, fill: { color: d.color }, line: { color: d.color } });
    s.addText(d.name, { x: x + 0.05, y: 1.0, w: 2.95, h: 0.48, fontSize: 12, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: x + 0.1, y: 1.55, w: 2.85, h: 0.35, fill: { color: d.color, transparency: 50 }, line: { color: d.color, width: 1 }, rectRadius: 0.05 });
    s.addText(d.mnemonic, { x: x + 0.1, y: 1.55, w: 2.85, h: 0.35, fontSize: 9, bold: true, italic: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    d.points.forEach((p, pi) => {
      s.addText("β€’ " + p, { x: x + 0.12, y: 2.02 + pi * 0.75, w: 2.85, h: 0.68, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 0 });
    });
  });
}

// ═══ SLIDE 7 β€” CNS INFECTIONS ══════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "05 | CNS Infections β€” Meningitis Bugs, CSF Table, Encephalitis, Prions", C.orange);

  // CSF Table
  s.addText("CSF Analysis β€” Quick Comparison", { x: 0.2, y: 1.0, w: 12.9, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const csfH = ["Feature", "BACTERIAL", "VIRAL (Aseptic)", "FUNGAL / TB"];
  const csfR = [
    ["Appearance", "Turbid / Cloudy", "Clear", "Clear or Turbid"],
    ["WBC", "High PMNs (>1000)", "High Lymphocytes", "High Lymphocytes"],
    ["Glucose", "VERY LOW (<40)", "Normal", "Low"],
    ["Protein", "VERY HIGH (>200)", "Slightly High", "High"],
    ["Opening P", "Elevated", "Normal/slight", "Elevated"],
  ];
  const csfCW = [2.1, 2.9, 3.0, 3.0];
  const csfCX = [0.2, 2.35, 5.3, 8.35];
  const csfHC = [C.cardBg, C.red, C.tealDk, C.purple];
  csfH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: csfCX[ci], y: 1.42, w: csfCW[ci], h: 0.42, fill: { color: csfHC[ci] }, line: { color: csfHC[ci] } });
    s.addText(h, { x: csfCX[ci] + 0.05, y: 1.42, w: csfCW[ci] - 0.1, h: 0.42, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0, align: ci > 0 ? "center" : "left" });
  });
  csfR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: csfCX[ci], y: 1.87 + ri * 0.42, w: csfCW[ci], h: 0.4, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.cardBg, width: 0 } });
      s.addText(cell, { x: csfCX[ci] + 0.05, y: 1.87 + ri * 0.42, w: csfCW[ci] - 0.1, h: 0.4, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0, align: ci > 0 ? "center" : "left" });
    });
  });

  // Bugs by age
  s.addText("Bacterial Meningitis Bugs by Age", { x: 0.2, y: 4.15, w: 6.5, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const ages = [
    { age: "0-3 months", bugs: "Group B Strep, E. coli, Listeria", memo: "GEL", color: C.red },
    { age: "3m - 18 yrs", bugs: "N. meningitidis, S. pneumoniae, H. influenzae", memo: "NSH", color: C.orange },
    { age: "Adults 18-50", bugs: "S. pneumoniae, N. meningitidis", memo: "SN", color: C.teal },
    { age: "Elderly / Immunocompromised", bugs: "S. pneumoniae + Listeria", memo: "SPL", color: C.purple },
  ];
  ages.forEach((a, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 0.2, y: 4.6 + i * 0.68, w: 2.1, h: 0.55, fill: { color: a.color }, line: { color: a.color }, rectRadius: 0.06 });
    s.addText(a.age, { x: 0.2, y: 4.6 + i * 0.68, w: 2.1, h: 0.55, fontSize: 8, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(a.bugs, { x: 2.45, y: 4.6 + i * 0.68, w: 3.8, h: 0.55, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    pill(s, "Memo: " + a.memo, 6.4, 4.65 + i * 0.68, 1.35, 0.4, a.color);
  });

  // Signs
  s.addText("Kernig's sign: Hip 90Β° flex - can't extend knee fully", { x: 0.2, y: 7.22, w: 7.5, h: 0.25, fontSize: 8.5, italic: true, color: C.gray });

  // HSV + Crypto boxes
  card(s, 8.0, 4.1, 5.1, 1.6, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 8.0, y: 4.1, w: 5.1, h: 0.38, fill: { color: C.red, transparency: 25 }, line: { color: C.red, width: 1 } });
  s.addText("HSV-1 Encephalitis", { x: 8.05, y: 4.1, w: 5.0, h: 0.38, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  s.addText("Temporal lobe | Fever + personality change + temporal seizures\nCSF: PCR for HSV DNA | Treatment: IV ACYCLOVIR (stat!)", { x: 8.05, y: 4.52, w: 5.0, h: 1.1, fontSize: 9, color: C.offWhite, valign: "top", margin: 0 });

  card(s, 8.0, 5.85, 5.1, 1.55, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 8.0, y: 5.85, w: 5.1, h: 0.38, fill: { color: C.purple, transparency: 25 }, line: { color: C.purple, width: 1 } });
  s.addText("Cryptococcus + Prion Disease (CJD)", { x: 8.05, y: 5.85, w: 5.0, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
  s.addText("Crypto: HIV CD4<100 | India Ink halo | Rx: Ampho B + Flucytosine\nCJD: Spongiform vacuolation | Myoclonus + rapid dementia | PrP protein", { x: 8.05, y: 6.27, w: 5.0, h: 1.05, fontSize: 9, color: C.offWhite, valign: "top", margin: 0 });
}

// ═══ SLIDE 8 β€” ENDOCRINE INTRO ═════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: "0A1628" };
  s.addShape(pres.shapes.RECTANGLE, { x: 13.0, y: 0, w: 0.3, h: 7.5, fill: { color: C.green }, line: { color: C.green } });
  s.addText("SECTION 2", { x: 0.6, y: 0.5, w: 12, h: 0.5, fontSize: 14, bold: true, color: C.green, charSpacing: 4 });
  s.addText("Endocrine\nPathology", { x: 0.6, y: 1.1, w: 12, h: 2.2, fontSize: 52, bold: true, color: C.white, fontFace: "Calibri" });
  s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.4, w: 4, h: 0.05, fill: { color: C.green }, line: { color: C.green } });
  const topics = [
    { label: "01", text: "Pituitary Disorders", color: C.teal },
    { label: "02", text: "Thyroid Disorders", color: C.green },
    { label: "03", text: "Adrenal Disorders", color: C.orange },
    { label: "04", text: "Diabetes Mellitus", color: C.red },
  ];
  topics.forEach((t, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.6, y: 3.7 + i * 0.78, w: 0.45, h: 0.48, fill: { color: t.color }, line: { color: t.color } });
    s.addText(t.label, { x: 0.6, y: 3.7 + i * 0.78, w: 0.45, h: 0.48, fontSize: 11, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(t.text, { x: 1.2, y: 3.75 + i * 0.78, w: 9, h: 0.4, fontSize: 18, color: C.white, valign: "middle", margin: 0 });
  });
}

// ═══ SLIDE 9 β€” PITUITARY ═══════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 01 | Pituitary Disorders β€” Hormones, Adenomas & DI Flowchart", C.teal);

  s.addText("Anterior Pituitary β€” Mnemonic: FLAT PiG", { x: 0.2, y: 1.0, w: 7.5, h: 0.38, fontSize: 13, bold: true, color: C.teal });
  const hormones = [
    { letter: "F", h: "FSH", note: "Follicle stimulating" },
    { letter: "L", h: "LH", note: "Luteinizing hormone" },
    { letter: "A", h: "ACTH", note: "Adrenocorticotropic" },
    { letter: "T", h: "TSH", note: "Thyroid stimulating" },
    { letter: "Pi", h: "PRL", note: "Prolactin" },
    { letter: "G", h: "GH", note: "Growth hormone" },
  ];
  hormones.forEach((h, i) => {
    const x = 0.2 + i * 2.15;
    s.addShape(pres.shapes.ELLIPSE, { x, y: 1.48, w: 1.8, h: 0.82, fill: { color: C.tealDk, transparency: 25 }, line: { color: C.teal, width: 1 } });
    s.addText(h.letter, { x, y: 1.48, w: 0.55, h: 0.82, fontSize: 18, bold: true, color: C.accent, align: "center", valign: "middle", margin: 0 });
    s.addText(h.h + "\n" + h.note, { x: x + 0.5, y: 1.48, w: 1.3, h: 0.82, fontSize: 8, color: C.white, valign: "middle", margin: 0 });
  });
  s.addText("Posterior: ADH + Oxytocin (made in hypothalamus, stored in posterior pituitary)", { x: 0.2, y: 2.4, w: 12.9, h: 0.35, fontSize: 10, italic: true, color: C.gray });

  s.addText("Pituitary Adenoma Types", { x: 0.2, y: 2.82, w: 7.5, h: 0.38, fontSize: 13, bold: true, color: C.teal });
  const adH = ["Adenoma", "Hormone", "Presentation"];
  const adR = [
    ["Prolactinoma (#1)", "Prolactin", "Amenorrhea + galactorrhea (F); Impotence (M) | Rx: Cabergoline"],
    ["Somatotroph", "GH", "Acromegaly (adult) / Gigantism (child) | Rx: Transsphenoidal surgery"],
    ["Corticotroph", "ACTH", "Cushing's DISEASE | Suppressed by high-dose dexamethasone"],
    ["Non-functioning", "None", "Mass effects: Bitemporal hemianopia (optic chiasm compression)"],
  ];
  const adCW = [2.4, 1.8, 8.7];
  const adCX = [0.2, 2.65, 4.5];
  adH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: adCX[ci], y: 3.25, w: adCW[ci], h: 0.38, fill: { color: C.tealDk }, line: { color: C.tealDk } });
    s.addText(h, { x: adCX[ci] + 0.05, y: 3.25, w: adCW[ci] - 0.1, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
  });
  adR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: adCX[ci], y: 3.67 + ri * 0.55, w: adCW[ci], h: 0.52, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.cardBg, width: 0 } });
      s.addText(cell, { x: adCX[ci] + 0.05, y: 3.67 + ri * 0.55, w: adCW[ci] - 0.1, h: 0.52, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  // DI flowchart
  s.addText("Diabetes Insipidus β€” Flowchart", { x: 0.2, y: 5.95, w: 12.9, h: 0.35, fontSize: 13, bold: true, color: C.accent });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 4.5, y: 6.35, w: 4.3, h: 0.55, fill: { color: C.tealDk }, line: { color: C.teal, width: 1 }, rectRadius: 0.07 });
  s.addText("DIABETES INSIPIDUS (Dilute urine, high serum Na)", { x: 4.5, y: 6.35, w: 4.3, h: 0.55, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.shapes.DOWN_ARROW, { x: 5.0, y: 6.95, w: 0.3, h: 0.38, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 3.5, y: 7.0, w: 2.8, h: 0.4, fill: { color: C.teal, transparency: 25 }, line: { color: C.teal, width: 1 }, rectRadius: 0.06 });
  s.addText("CENTRAL DI (ADH deficient)\nRx: Desmopressin", { x: 3.5, y: 7.0, w: 2.8, h: 0.4, fontSize: 8.5, color: C.white, align: "center", valign: "middle", margin: 0 });

  s.addShape(pres.shapes.DOWN_ARROW, { x: 7.97, y: 6.95, w: 0.3, h: 0.38, fill: { color: C.purple }, line: { color: C.purple } });
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 7.0, y: 7.0, w: 2.8, h: 0.4, fill: { color: C.purple, transparency: 25 }, line: { color: C.purple, width: 1 }, rectRadius: 0.06 });
  s.addText("NEPHROGENIC DI (ADH resistant)\nRx: Thiazides + Low Na diet", { x: 7.0, y: 7.0, w: 2.8, h: 0.4, fontSize: 8.5, color: C.white, align: "center", valign: "middle", margin: 0 });
}

// ═══ SLIDE 10 β€” THYROID ════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 02 | Thyroid Disorders β€” Hypo vs Hyper + Cancer PaFoMeAn", C.green);

  card(s, 0.2, 1.0, 6.15, 3.4, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.0, w: 6.15, h: 0.45, fill: { color: "1B4332" }, line: { color: "1B4332" } });
  s.addText("HYPOTHYROIDISM β€” Mnemonic: SLOW BM", { x: 0.3, y: 1.0, w: 6.0, h: 0.45, fontSize: 12, bold: true, color: C.green, valign: "middle", margin: 0 });
  const hypo = [
    ["S", "Sensitivity to cold"],
    ["L", "Lethargy + depression"],
    ["O", "Obesity (weight gain)"],
    ["W", "Water retention (myxedema)"],
    ["B", "Bradycardia"],
    ["M", "Menorrhagia + constipation"],
  ];
  hypo.forEach(([l, v], i) => {
    const col = i % 2, row = Math.floor(i / 2);
    s.addShape(pres.shapes.ELLIPSE, { x: 0.3 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fill: { color: C.green }, line: { color: C.green } });
    s.addText(l, { x: 0.3 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fontSize: 12, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 0.75 + col * 3.0, y: 1.55 + row * 0.65, w: 2.6, h: 0.35, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Cause #1 West: Hashimoto's (anti-TPO, anti-Tg, Hurthle cells) | Rx: Levothyroxine", { x: 0.3, y: 3.62, w: 5.9, h: 0.35, fontSize: 8.5, italic: true, color: C.gray, valign: "middle", margin: 0 });

  card(s, 6.95, 1.0, 6.15, 3.4, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 6.95, y: 1.0, w: 6.15, h: 0.45, fill: { color: "1C3D2B" }, line: { color: "1C3D2B" } });
  s.addText("HYPERTHYROIDISM β€” Mnemonic: FAST THY", { x: 7.05, y: 1.0, w: 6.0, h: 0.45, fontSize: 12, bold: true, color: C.teal, valign: "middle", margin: 0 });
  const hyper = [
    ["F", "Flushing, heat intolerance"],
    ["A", "Arrhythmia (Afib), anxiety"],
    ["S", "Skinny (wt loss, diarrhea)"],
    ["T", "Tremor + tachycardia"],
    ["T", "Thyroid goiter"],
    ["HY", "High T3/T4, young women"],
  ];
  hyper.forEach(([l, v], i) => {
    const col = i % 2, row = Math.floor(i / 2);
    s.addShape(pres.shapes.ELLIPSE, { x: 7.05 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fill: { color: C.teal }, line: { color: C.teal } });
    s.addText(l, { x: 7.05 + col * 3.0, y: 1.55 + row * 0.65, w: 0.35, h: 0.35, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(v, { x: 7.5 + col * 3.0, y: 1.55 + row * 0.65, w: 2.6, h: 0.35, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Graves' triad: Hyperthyroid + Exophthalmos + Pretibial myxedema | Rx: PTU (pregnancy), I-131, Beta-blocker", { x: 7.05, y: 3.62, w: 5.9, h: 0.35, fontSize: 8.5, italic: true, color: C.gray, valign: "middle", margin: 0 });

  s.addText("Thyroid Cancer β€” PaFoMeAn (Best to Worst Prognosis)", { x: 0.2, y: 4.55, w: 12.9, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const cancers = [
    { name: "PAPILLARY  80%", color: C.green, key: "Orphan Annie nuclei\nPsammoma bodies\nRET/PTC mutation\nCervical LN mets (good Px)" },
    { name: "FOLLICULAR  10%", color: C.teal, key: "Hematogenous spread\nVascular invasion\nNo LN mets\nRAI responsive" },
    { name: "MEDULLARY  5-8%", color: C.orange, key: "C-cells - Calcitonin\nAmyloid stroma\nRET mutation\nMEN2A / MEN2B" },
    { name: "ANAPLASTIC  <5%", color: C.red, key: "Elderly patients\nRapidly fatal\nNo RAI response\nWorst prognosis" },
  ];
  cancers.forEach((c, i) => {
    const x = 0.2 + i * 3.27;
    card(s, x, 5.0, 3.05, 2.4, C.cardBg);
    s.addShape(pres.shapes.RECTANGLE, { x, y: 5.0, w: 3.05, h: 0.4, fill: { color: c.color }, line: { color: c.color } });
    s.addText(c.name, { x: x + 0.05, y: 5.0, w: 2.95, h: 0.4, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0 });
    s.addText(c.key, { x: x + 0.1, y: 5.45, w: 2.85, h: 1.85, fontSize: 8.5, color: C.offWhite, valign: "top", margin: 0 });
  });
}

// ═══ SLIDE 11 β€” ADRENAL ════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 03 | Adrenal Disorders β€” GFR Zones + Cushing/Addison/Conn/Pheo", C.orange);

  s.addText("Adrenal Zones β€” GFR Mnemonic (outside to inside)", { x: 0.2, y: 1.0, w: 5.7, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const zones = [
    { name: "G - Glomerulosa", makes: "Aldosterone", color: C.teal, w: 5.2 },
    { name: "F - Fasciculata", makes: "Cortisol (longest zone)", color: C.orange, w: 4.0 },
    { name: "R - Reticularis", makes: "Androgens (DHEA)", color: C.purple, w: 3.0 },
    { name: "Medulla", makes: "Catecholamines (Epi >> NE)", color: C.red, w: 2.2 },
  ];
  zones.forEach((z, i) => {
    s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 1.48 + i * 0.62, w: z.w, h: 0.55, fill: { color: z.color, transparency: 30 }, line: { color: z.color, width: 1 } });
    s.addText(z.name + "  β†’  " + z.makes, { x: 0.3, y: 1.48 + i * 0.62, w: z.w - 0.15, h: 0.55, fontSize: 9.5, bold: true, color: C.white, valign: "middle", margin: 0 });
  });
  s.addText("Memory: 'Go Find Rex' β€” Rex lives in the Medulla", { x: 0.2, y: 4.02, w: 5.7, h: 0.3, fontSize: 9, italic: true, color: C.gray });

  card(s, 5.9, 1.0, 7.2, 2.9, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 5.9, y: 1.0, w: 7.2, h: 0.4, fill: { color: C.orange, transparency: 20 }, line: { color: C.orange, width: 1 } });
  s.addText("Cushing's Syndrome β€” Mnemonic: CUSHINGS", { x: 6.0, y: 1.0, w: 7.0, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  const cush = ["C - Central obesity (moon face, buffalo hump)","U - Urine cortisol elevated","S - Striae (purple)","H - Hypertension","I - Insulin resistance","N - No menses (amenorrhea)","G - Glucose elevated","S - Skin thinning + easy bruising"];
  cush.forEach((c, i) => {
    const col = i % 2, row = Math.floor(i / 2);
    s.addText("β€’ " + c, { x: 6.0 + col * 3.5, y: 1.5 + row * 0.46, w: 3.4, h: 0.42, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Dx: High-dose Dex suppresses PITUITARY only β€” not ectopic ACTH, not adrenal", { x: 6.0, y: 3.55, w: 7.0, h: 0.32, fontSize: 8.5, italic: true, color: C.gray, margin: 0 });

  card(s, 0.2, 4.42, 4.3, 2.8, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 0.2, y: 4.42, w: 4.3, h: 0.4, fill: { color: C.teal, transparency: 20 }, line: { color: C.teal, width: 1 } });
  s.addText("Addison's Disease β€” SHADE", { x: 0.3, y: 4.42, w: 4.1, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  ["S - Skin hyperpigmentation (ACTH→MSH)","H - Hypotension + Hyperkalemia","A - Anemia (normocytic)","D - Dehydration (Na wasting)","E - Electrolytes: Low Na, High K"].forEach((p, i) => {
    s.addText("β€’ " + p, { x: 0.3, y: 4.9 + i * 0.42, w: 4.0, h: 0.38, fontSize: 8.8, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Rx: IV Hydrocortisone + IV Saline (crisis)", { x: 0.3, y: 7.0, w: 4.0, h: 0.3, fontSize: 8, italic: true, color: C.gray });

  card(s, 4.7, 4.42, 4.0, 2.8, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 4.7, y: 4.42, w: 4.0, h: 0.4, fill: { color: C.green, transparency: 20 }, line: { color: C.green, width: 1 } });
  s.addText("Conn's Syndrome β€” HANK", { x: 4.8, y: 4.42, w: 3.8, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  ["H - Hypertension (resistant)","A - Alkalosis (metabolic)","N - No renin (low renin = primary)","K - K+ low (hypokalemia)"].forEach((p, i) => {
    s.addText("β€’ " + p, { x: 4.8, y: 4.9 + i * 0.48, w: 3.8, h: 0.45, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Cause: Adrenal adenoma | Rx: Surgery or Spironolactone", { x: 4.8, y: 7.0, w: 3.8, h: 0.3, fontSize: 8, italic: true, color: C.gray });

  card(s, 8.9, 4.42, 4.2, 2.8, C.cardBg);
  s.addShape(pres.shapes.RECTANGLE, { x: 8.9, y: 4.42, w: 4.2, h: 0.4, fill: { color: C.red, transparency: 20 }, line: { color: C.red, width: 1 } });
  s.addText("Pheochromocytoma β€” 5 P's", { x: 9.0, y: 4.42, w: 4.0, h: 0.4, fontSize: 11, bold: true, color: C.white, valign: "middle", margin: 0 });
  ["P - Paroxysmal HTN","P - Palpitations","P - Perspiration (diaphoresis)","P - Pallor","P - Pain (headache)"].forEach((p, i) => {
    s.addText("β€’ " + p, { x: 9.0, y: 4.9 + i * 0.42, w: 3.95, h: 0.38, fontSize: 9, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Rule of 10s | Dx: Urine metanephrines\nRx: Alpha-block FIRST, then beta-block, then surgery", { x: 9.0, y: 6.65, w: 3.95, h: 0.55, fontSize: 7.5, italic: true, color: C.gray });
}

// ═══ SLIDE 12 β€” DIABETES ═══════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionBar(s, "Endocrine 04 | Diabetes Mellitus β€” T1 vs T2, DKA vs HHS, Drugs", C.red);

  s.addText("Type 1 vs Type 2 Diabetes", { x: 0.2, y: 1.0, w: 12.9, h: 0.38, fontSize: 13, bold: true, color: C.red });
  const dmH = ["Feature", "TYPE 1", "TYPE 2"];
  const dmR = [
    ["Pathology", "Autoimmune beta-cell destruction", "Insulin resistance + relative deficiency"],
    ["Age", "< 30 (child / young adult)", "> 40 (middle-aged / elderly)"],
    ["Body type", "Thin", "Obese"],
    ["Ketoacidosis", "YES β€” DKA (classic)", "Rare β€” HHS instead"],
    ["Autoantibodies", "Anti-GAD, Anti-islet cell", "None"],
    ["HLA link", "DR3, DR4", "No HLA link"],
    ["Treatment", "Insulin ONLY", "Lifestyle - Metformin - add-ons - Insulin"],
  ];
  const dmCW = [2.2, 5.3, 5.5];
  const dmCX = [0.2, 2.45, 7.8];
  dmH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: dmCX[ci], y: 1.42, w: dmCW[ci], h: 0.38, fill: { color: ci === 1 ? C.tealDk : (ci === 2 ? "7F1D1D" : C.cardBg) }, line: { color: C.red, width: 1 } });
    s.addText(h, { x: dmCX[ci] + 0.05, y: 1.42, w: dmCW[ci] - 0.1, h: 0.38, fontSize: 10, bold: true, color: C.white, valign: "middle", margin: 0, align: ci === 0 ? "left" : "center" });
  });
  dmR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: dmCX[ci], y: 1.84 + ri * 0.46, w: dmCW[ci], h: 0.44, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.cardBg, width: 0 } });
      s.addText(cell, { x: dmCX[ci] + 0.05, y: 1.84 + ri * 0.46, w: dmCW[ci] - 0.1, h: 0.44, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  s.addText("DKA vs HHS β€” Critical Comparison", { x: 0.2, y: 5.15, w: 7.0, h: 0.38, fontSize: 13, bold: true, color: C.orange });
  const dkaH = ["Feature", "DKA (Type 1)", "HHS (Type 2)"];
  const dkaR = [
    ["Glucose", "> 250 mg/dL", "> 600 mg/dL"],
    ["pH", "< 7.3 (ACIDOSIS)", "Normal (> 7.3)"],
    ["Ketones", "YES (+++)", "Minimal / absent"],
    ["Osmolality", "Mildly elevated", "> 320 mOsm/kg"],
    ["Mortality", "~1%", "~15% (worse!)"],
  ];
  const dkaCW = [2.0, 2.5, 2.5];
  const dkaCX = [0.2, 2.25, 4.8];
  dkaH.forEach((h, ci) => {
    s.addShape(pres.shapes.RECTANGLE, { x: dkaCX[ci], y: 5.57, w: dkaCW[ci], h: 0.38, fill: { color: ci === 1 ? C.tealDk : (ci === 2 ? "7F1D1D" : C.cardBg) }, line: { color: C.orange, width: 1 } });
    s.addText(h, { x: dkaCX[ci] + 0.05, y: 5.57, w: dkaCW[ci] - 0.1, h: 0.38, fontSize: 9, bold: true, color: C.white, valign: "middle", margin: 0, align: ci === 0 ? "left" : "center" });
  });
  dkaR.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      s.addShape(pres.shapes.RECTANGLE, { x: dkaCX[ci], y: 5.99 + ri * 0.42, w: dkaCW[ci], h: 0.4, fill: { color: ri % 2 === 0 ? C.cardBg : C.cardBg2 }, line: { color: C.cardBg, width: 0 } });
      s.addText(cell, { x: dkaCX[ci] + 0.05, y: 5.99 + ri * 0.42, w: dkaCW[ci] - 0.1, h: 0.4, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
    });
  });

  s.addText("Key Oral Antidiabetics", { x: 7.6, y: 5.15, w: 5.5, h: 0.38, fontSize: 13, bold: true, color: C.green });
  const drugs = [
    { name: "Metformin", memo: "#1 T2DM | No hypoglycemia | Lactic acidosis risk", color: C.green },
    { name: "Sulfonylureas", memo: "Stimulate insulin secretion | CAN cause hypoglycemia", color: C.orange },
    { name: "GLP-1 agonists", memo: "Weight loss | Used in obese T2DM (Liraglutide)", color: C.teal },
    { name: "SGLT2 inhibitors", memo: "Glucosuria | UTI risk | Cardioprotective (Empagliflozin)", color: C.purple },
  ];
  drugs.forEach((d, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 7.6, y: 5.6 + i * 0.48, w: 2.0, h: 0.38, fill: { color: d.color }, line: { color: d.color }, rectRadius: 0.06 });
    s.addText(d.name, { x: 7.6, y: 5.6 + i * 0.48, w: 2.0, h: 0.38, fontSize: 9, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(d.memo, { x: 9.7, y: 5.6 + i * 0.48, w: 3.4, h: 0.38, fontSize: 8, color: C.offWhite, valign: "middle", margin: 0 });
  });

  s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 7.6, y: 7.1, w: 5.5, h: 0.35, fill: { color: C.red, transparency: 40 }, line: { color: C.red, width: 1 }, rectRadius: 0.05 });
  s.addText("CRAMPS Complications: Cardiovascular | Retinopathy | Atherosclerosis | Micro-albuminuria | Peripheral neuropathy | Susceptibility to infection", { x: 7.65, y: 7.1, w: 5.4, h: 0.35, fontSize: 7.5, color: C.white, valign: "middle", margin: 0 });
}

// ═══ SLIDE 13 β€” ONE-LINE KILLERS ═══════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  sectionBar(s, "RAPID RECALL β€” One-Line Killers for MCQs", C.teal);

  const killers = [
    ["Periventricular lesions, young woman", "Multiple Sclerosis", C.teal],
    ["Ascending paralysis after Campylobacter", "GBS", C.teal],
    ["'Worst HA of my life'", "SAH β€” Berry aneurysm", C.red],
    ["Xanthochromia in CSF", "Subarachnoid Hemorrhage", C.red],
    ["Temporal lobe + fever + personality change", "HSV Encephalitis β€” ACYCLOVIR", C.orange],
    ["Pill-rolling tremor + cogwheel rigidity", "Parkinson's β€” Lewy bodies", C.purple],
    ["Beta-amyloid + neurofibrillary tangles", "Alzheimer's Disease", C.purple],
    ["Orphan Annie nuclei + Psammoma bodies", "Papillary Thyroid Cancer", C.green],
    ["Calcitonin-secreting tumor", "Medullary Thyroid Ca (MEN2)", C.green],
    ["High aldosterone + low renin + low K+", "Conn's Syndrome", C.orange],
    ["Paroxysmal HTN + diaphoresis", "Pheochromocytoma", C.red],
    ["Skin hyperpigmentation + low Na + high K+", "Addison's Disease", C.teal],
    ["Moon face + buffalo hump + purple striae", "Cushing's Syndrome", C.orange],
    ["Bitemporal hemianopia", "Pituitary tumor (chiasm compression)", C.purple],
    ["High protein + normal WBC in CSF", "GBS (albuminocytologic dissociation)", C.teal],
    ["India Ink halo + HIV patient", "Cryptococcus meningitis", C.green],
    ["Spongiform vacuolation + myoclonus", "CJD β€” Prion disease", C.red],
    ["Butterfly glioma crossing corpus callosum", "GBM (Grade IV)", C.purple],
    ["Homer-Wright rosettes, child, cerebellum", "Medulloblastoma", C.orange],
    ["Fried egg cells + 1p/19q deletion", "Oligodendroglioma", C.teal],
  ];
  const left = killers.slice(0, 10);
  const right = killers.slice(10);
  [left, right].forEach((col, ci) => {
    col.forEach(([clue, ans, color], ri) => {
      const x = ci === 0 ? 0.2 : 6.75;
      const y = 1.0 + ri * 0.63;
      s.addShape(pres.shapes.RECTANGLE, { x, y, w: 6.4, h: 0.55, fill: { color: C.cardBg }, line: { color: color, width: 1 } });
      s.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.12, h: 0.55, fill: { color: color }, line: { color: color } });
      s.addText(clue, { x: x + 0.2, y, w: 3.8, h: 0.55, fontSize: 8.5, color: C.offWhite, valign: "middle", margin: 0 });
      s.addShape(pres.shapes.RIGHT_ARROW, { x: x + 4.05, y: y + 0.15, w: 0.3, h: 0.25, fill: { color: color }, line: { color: color } });
      s.addText(ans, { x: x + 4.45, y, w: 1.85, h: 0.55, fontSize: 8, bold: true, color: color, valign: "middle", margin: 0 });
    });
  });
}

// ═══ SLIDE 14 β€” CLOSING ════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  s.background = { color: C.navy };
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
  s.addShape(pres.shapes.RECTANGLE, { x: 13.12, y: 0, w: 0.18, h: 7.5, fill: { color: C.teal }, line: { color: C.teal } });
  s.addText("Good luck on your exams!", { x: 1.0, y: 1.2, w: 11.3, h: 1.2, fontSize: 40, bold: true, color: C.white, align: "center", fontFace: "Calibri" });
  s.addText("Master these mnemonics and you will ace your MCQs.", { x: 1.0, y: 2.5, w: 11.3, h: 0.6, fontSize: 20, color: C.teal, align: "center" });
  s.addShape(pres.shapes.RECTANGLE, { x: 3.5, y: 3.2, w: 6.3, h: 0.04, fill: { color: C.teal }, line: { color: C.teal } });
  const mnems = [
    { label: "CNS", text: "SPASM (MS)  |  GAME / CAME (Tumors)  |  TRAP (Parkinson's)  |  ABCs (Alzheimer's)" },
    { label: "Endocrine", text: "FLAT PiG (Pituitary)  |  SLOW BM (Hypo)  |  FAST THY (Hyper)  |  PaFoMeAn (Thyroid Ca)" },
    { label: "Adrenal", text: "GFR zones  |  CUSHINGS  |  SHADE (Addison's)  |  HANK (Conn's)  |  5 P's (Pheo)" },
    { label: "Diabetes", text: "CRAMPS (complications)  |  RAIN (insulin types)  |  DKA vs HHS comparison" },
  ];
  mnems.forEach((m, i) => {
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 1.0, y: 3.45 + i * 0.85, w: 1.6, h: 0.6, fill: { color: C.tealDk }, line: { color: C.teal, width: 1 }, rectRadius: 0.06 });
    s.addText(m.label, { x: 1.0, y: 3.45 + i * 0.85, w: 1.6, h: 0.6, fontSize: 10, bold: true, color: C.white, align: "center", valign: "middle", margin: 0 });
    s.addText(m.text, { x: 2.75, y: 3.48 + i * 0.85, w: 10.0, h: 0.55, fontSize: 9.5, color: C.offWhite, valign: "middle", margin: 0 });
  });
  s.addText("Prepared by Orris β€” Your AI Study Companion", { x: 1.0, y: 7.1, w: 11.3, h: 0.3, fontSize: 10, color: C.gray, align: "center" });
}

pres.writeFile({ fileName: "/home/daytona/workspace/med-study-pptx/CNS_Endocrine_HighYield.pptx" })
  .then(() => console.log("SUCCESS"))
  .catch(e => { console.error("ERROR:", e.message); process.exit(1); });
This is a shared conversation. Sign in to Orris to start your own chat.