Cns examination Pediatric

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
I now have excellent material from the Harriet Lane Handbook and Bradley & Daroff's Neurology. Let me compile a comprehensive answer.

CNS Examination in Pediatrics

The pediatric neurological examination differs significantly from adults because it must be adapted to the child's developmental stage. Observation is often more informative than formal testing, especially in infants and toddlers.
(Source: The Harriet Lane Handbook, 23rd ed. - Johns Hopkins Hospital; Bradley and Daroff's Neurology in Clinical Practice)

I. MENTAL STATUS

Age-adapted approach:
AgeApproach
InfantsObserve "cuteness," social smile, ability to dynamically engage caretakers
ToddlersBring toys; observe and engage in play
School ageAsk to draw, describe school or friends
All agesAlertness, orientation (person, place, time, situation), language, cognition

II. CRANIAL NERVES (CN I-XII)

Quick assessment for all patients - observe:
CNTest
I (Olfactory)Smell (test when anosmia suspected, head injury, Parkinson's risk)
II (Optic)Infants: fix and follow, red reflex; Older: Snellen chart, fundoscopy, visual fields by confrontation
II/III (Pupillary reflex)Response to light, relative afferent pupillary defect (RAPD)
III, IV, VIConjugate gaze at full lateral and vertical positions; nystagmus; ptosis; pupil symmetry
V (Trigeminal)Facial sensation (forehead, cheek, chin), corneal reflex, jaw movements
VII (Facial)Symmetry and expressiveness at rest and with emotive activation (smile, raise eyebrows)
VIII (Vestibulocochlear)Infants: response to and localization of sound; older: finger rub
IX, X (Glossopharyngeal/Vagus)Quality of phonation, articulation; ask about feeding, chewing, swallowing; gag reflex
XI (Accessory)Shoulder shrug, head turning against resistance
XII (Hypoglossal)Tongue protrusion, tongue movement; ask about articulation

III. MOTOR EXAMINATION

1. Muscle Bulk

  • Atrophy or pseudohypertrophy (calf pseudohypertrophy in Duchenne MD) = red flag

2. Tone

  • Spasticity, rigidity, hypotonia - all must be distinguished
  • Infants (observe undressed):
    • Resting posture - varies by age
    • Active tone: Traction response, axillary stability ("slip-through" sign), posture in horizontal suspension (ventral/prone suspension)
    • Passive tone: Flap hands/feet; scarf sign (pull arm across chest, observe elbow position relative to midline)
  • Red flags: Scissoring, toe-walking, inability to supinate hand, clasped thumb, persistent fisting

3. Strength

  • Younger children: Observe functional tasks - rising from floor (Gower's sign), standing broad jump, running, climbing onto table
  • Older children: Confrontation testing against resistance, pronator drift (arms extended in supination, eyes closed)
  • MRC grading (Box 20.1):
GradeMeaning
0No contraction
1Flicker only
2Movement with gravity eliminated
3Movement against gravity
4Movement against resistance (subnormal)
5Normal

4. Involuntary Movements

Note: fasciculations, tics, dystonia, chorea, athetosis, myoclonus, tremor

IV. REFLEXES

Deep Tendon Reflexes (DTRs)

  • Biceps (C5-6), triceps (C7), brachioradialis (C6), knee/patellar (L3-4), ankle/Achilles (S1-2)
  • Grade 0 to 4+; note symmetry

Pathological Reflexes

  • Babinski sign: Extensor plantar response (upgoing toe) - normal in infants <12-18 months, pathological afterward
  • Clonus: Sustained rhythmic contractions = upper motor neuron (UMN) lesion
  • Hoffman's sign: In older children - flick middle finger, thumb flexes = UMN

Primitive Reflexes (infants - normally disappear with age)

ReflexAppearsDisappears
MoroBirth4-6 months
RootingBirth3-4 months
Palmar graspBirth3-6 months
Plantar graspBirth9-12 months
Asymmetric tonic neck reflex (ATNR)Birth4-6 months
SteppingBirth2-3 months
Parachute (protective)~8-9 monthsPersists
Persistence beyond normal age = concern for cerebral palsy or UMN pathology

V. COORDINATION

  • Cerebellar: Finger-nose-finger, heel-knee-shin, rapid alternating movements (dysdiadochokinesia)
  • Infant equivalent: Watch reach and grasp for tremor or dysmetria
  • Romberg test: Stand with feet together, eyes open then closed (assesses proprioception)

VI. GAIT

  • Observe base width, arm swing, toe clearance, heel strike
  • Heel-to-toe (tandem) walking: Tests cerebellar function
  • Toe walking: May suggest spastic diplegia, autism, or sensory processing disorder
  • Waddling gait: Suggests proximal myopathy (e.g., Duchenne MD)
  • Steppage gait: Foot drop (peripheral neuropathy, peroneal nerve palsy)
  • Scissor gait: Spastic cerebral palsy

VII. SENSORY EXAMINATION

  • Younger children: Use light touch, pin-prick - observe facial response or withdrawal
  • Older children: Standard modalities:
    • Primary: Light touch, pin-prick (pain), temperature, vibration (128 Hz tuning fork), joint position (proprioception)
    • Cortical: Graphesthesia, stereognosis, two-point discrimination, sensory extinction (double simultaneous stimulation)

VIII. HEAD CIRCUMFERENCE & FONTANELLE (Infants)

  • Measure and plot occipitofrontal circumference (OFC) on growth chart at every visit
  • Macrocephaly (>98th percentile): Hydrocephalus, megalencephaly, subdural collections
  • Microcephaly (<2nd percentile): Congenital infection (TORCH), genetic syndromes, hypoxic-ischemic injury
  • Anterior fontanelle: Normally closes by 9-18 months; bulging = raised ICP; sunken = dehydration

IX. KEY RED FLAGS IN PEDIATRIC CNS EXAM

  • Loss of previously acquired milestones (developmental regression)
  • Focal neurological deficits (asymmetric reflexes, weakness, cranial nerve palsy)
  • Macrocephaly with rapid head growth
  • Persistent primitive reflexes beyond expected age
  • Persistent Babinski after 18 months
  • Spasticity, scissoring, toe-walking
  • Papilledema (sign of raised ICP)
  • Nystagmus (especially vertical or see-saw)
  • Ataxia + head tilt (posterior fossa mass until proven otherwise)

X. SPECIAL CONSIDERATIONS BY AGE

AgeKey Focus
NeonateTone, primitive reflexes, cry quality, fontanelle, suck/swallow
Infant (1-12 mo)Milestone tracking, head control, social smile, fixation/following
Toddler (1-3 yr)Language, gait, play behavior, hand dominance (early dominance = contralateral UMN lesion)
School ageFull formal exam possible; attention, learning, behavior also assessed
AdolescentAdult-style exam; screen for depression, substance use

Sources: The Harriet Lane Handbook 23rd Edition (Johns Hopkins Hospital) | Bradley and Daroff's Neurology in Clinical Practice

Ppt Santhosh Kumar as reference Ppt

Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/cns-peds-ppt && ls /tmp/workspace/cns-peds-ppt/

Writing File

~/cns-peds-ppt/create_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from io import BytesIO

prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)

# ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
DARK_BLUE   = RGBColor(0x0D, 0x47, 0x6E)   # deep navy
MID_BLUE    = RGBColor(0x16, 0x78, 0xB1)   # heading accent
LIGHT_BLUE  = RGBColor(0xD6, 0xEA, 0xF8)   # cell / bg fills
ACCENT_TEAL = RGBColor(0x00, 0x8B, 0x8B)   # teal accent
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
DARK_GRAY   = RGBColor(0x2C, 0x2C, 0x2C)
MID_GRAY    = RGBColor(0x55, 0x55, 0x55)
RED         = RGBColor(0xC0, 0x39, 0x2B)
YELLOW      = RGBColor(0xFF, 0xC3, 0x00)
LIME        = RGBColor(0x27, 0xAE, 0x60)

blank = prs.slide_layouts[6]

# ─── HELPERS ──────────────────────────────────────────────────────────────────
def add_rect(slide, x, y, w, h, fill_color, alpha=None):
    shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill_color
    shape.line.fill.background()
    return shape

def add_text(slide, text, x, y, w, h, size=20, bold=False, color=DARK_GRAY,
             align=PP_ALIGN.LEFT, italic=False, wrap=True, anchor=MSO_ANCHOR.TOP):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.vertical_anchor = anchor
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(size)
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name = "Calibri"
    return tf

def add_multiline(slide, lines, x, y, w, h, size=16, color=DARK_GRAY, bold_first=False,
                  bullet=True, line_spacing=1.2):
    """lines: list of (text, bold) or plain strings"""
    from pptx.oxml.ns import qn
    from lxml import etree
    import copy

    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(2)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)

    for i, line in enumerate(lines):
        if isinstance(line, tuple):
            txt, bld = line
        else:
            txt, bld = line, False

        if i == 0:
            p = tf.paragraphs[0]
        else:
            p = tf.add_paragraph()

        p.alignment = PP_ALIGN.LEFT
        run = p.add_run()
        prefix = "• " if bullet and not bld else ""
        run.text = prefix + txt
        run.font.size = Pt(size)
        run.font.bold = bld
        run.font.color.rgb = color
        run.font.name = "Calibri"
    return tf

def header_bar(slide, title, subtitle=None):
    """Top navy bar with title."""
    add_rect(slide, 0, 0, 13.333, 1.1, DARK_BLUE)
    add_text(slide, title, 0.3, 0.08, 10, 0.9, size=34, bold=True,
             color=WHITE, align=PP_ALIGN.LEFT, anchor=MSO_ANCHOR.MIDDLE)
    if subtitle:
        add_text(slide, subtitle, 0.3, 0.7, 12, 0.45, size=16,
                 color=LIGHT_BLUE, align=PP_ALIGN.LEFT)
    # bottom accent line
    add_rect(slide, 0, 1.1, 13.333, 0.06, ACCENT_TEAL)

def footer(slide, ref="Reference: Santhosh Kumar - Pediatric Clinical Methods"):
    add_rect(slide, 0, 7.15, 13.333, 0.35, DARK_BLUE)
    add_text(slide, ref, 0.3, 7.17, 12, 0.3, size=11,
             color=LIGHT_BLUE, align=PP_ALIGN.LEFT)

def section_card(slide, title, x, y, w, h, fill=LIGHT_BLUE, title_color=DARK_BLUE):
    add_rect(slide, x, y, w, 0.42, fill)
    add_rect(slide, x, y + 0.42, w, h - 0.42, RGBColor(0xF0, 0xF8, 0xFF))
    add_text(slide, title, x + 0.1, y + 0.02, w - 0.2, 0.38,
             size=17, bold=True, color=title_color,
             align=PP_ALIGN.LEFT, anchor=MSO_ANCHOR.MIDDLE)
    return (x + 0.1, y + 0.46, w - 0.2, h - 0.5)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 1 — TITLE
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE)
# diagonal accent
add_rect(slide, 0, 5.5, 13.333, 2.0, MID_BLUE)
add_rect(slide, 0, 6.8, 13.333, 0.7, ACCENT_TEAL)

add_text(slide, "CNS Examination", 0.6, 1.0, 12, 1.5,
         size=52, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
         anchor=MSO_ANCHOR.MIDDLE)
add_text(slide, "in Pediatrics", 0.6, 2.3, 12, 1.0,
         size=40, bold=True, color=YELLOW, align=PP_ALIGN.CENTER,
         anchor=MSO_ANCHOR.MIDDLE)
add_text(slide, "A Systematic Clinical Approach", 0.6, 3.3, 12, 0.7,
         size=22, bold=False, color=LIGHT_BLUE, align=PP_ALIGN.CENTER)

add_rect(slide, 3.5, 4.1, 6.333, 0.05, ACCENT_TEAL)

add_text(slide, "Reference: Santhosh Kumar – Pediatric Clinical Methods",
         0.6, 4.3, 12, 0.5, size=16, color=YELLOW,
         align=PP_ALIGN.CENTER)
add_text(slide, "CNS | Pediatrics | Clinical Examination",
         0.6, 6.9, 12, 0.5, size=13, color=WHITE,
         align=PP_ALIGN.CENTER)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 2 — OVERVIEW / OUTLINE
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Overview of Pediatric CNS Examination")
footer(slide)

topics = [
    ("1", "Mental Status & Developmental Assessment"),
    ("2", "Cranial Nerve Examination (CN I–XII)"),
    ("3", "Motor System — Tone, Bulk, Strength"),
    ("4", "Reflexes — Deep Tendon & Primitive"),
    ("5", "Coordination & Cerebellar Function"),
    ("6", "Sensory Examination"),
    ("7", "Gait Analysis"),
    ("8", "Head Circumference & Fontanelle"),
    ("9", "Red Flags & Age-wise Approach"),
]

cols = [(0.4, 3), (6.8, 3)]
rows_per_col = 5
for i, (num, topic) in enumerate(topics):
    col_idx = 0 if i < rows_per_col else 1
    row_idx = i if i < rows_per_col else i - rows_per_col
    cx, cw = cols[col_idx]
    ypos = 1.35 + row_idx * 1.08
    add_rect(slide, cx, ypos, 0.55, 0.7, MID_BLUE)
    add_text(slide, num, cx, ypos, 0.55, 0.7, size=22, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide, cx + 0.55, ypos, cw - 0.55, 0.7, LIGHT_BLUE)
    add_text(slide, topic, cx + 0.65, ypos + 0.02, cw - 0.75, 0.66,
             size=16, bold=False, color=DARK_BLUE,
             anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 3 — MENTAL STATUS
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Mental Status Examination", "Age-adapted approach")
footer(slide)

# Age bands
bands = [
    ("NEONATES / INFANTS", MID_BLUE,
     ["Alertness — eyes open, response to stimuli",
      "Social smile by 6 weeks",
      "Fix and follow (bright object) by 6–8 weeks",
      "Cry quality — weak cry = CN X/bulbar involvement",
      "Observe 'cuteness' and dynamic engagement with caretakers"]),
    ("TODDLERS (1–3 yr)", ACCENT_TEAL,
     ["Bring toys — observe and engage in play",
      "Language milestones: single words by 1 yr, 2-word phrases by 2 yr",
      "Follows simple commands",
      "Symbolic play begins ~18 months"]),
    ("SCHOOL AGE / ADOLESCENT", RGBColor(0x6C, 0x35, 0x82),
     ["Ask to draw, describe school or friends",
      "Orientation: Person, Place, Time, Situation",
      "Cognition: memory, attention, calculation",
      "Language: fluency, comprehension, repetition, naming"]),
]

ystart = 1.28
for i, (title, col, pts) in enumerate(bands):
    bx = 0.3 + i * 4.35
    add_rect(slide, bx, ystart, 4.1, 0.45, col)
    add_text(slide, title, bx + 0.1, ystart + 0.03, 3.9, 0.38,
             size=13, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
    content_y = ystart + 0.5
    for j, pt in enumerate(pts):
        add_rect(slide, bx, content_y + j*0.88, 4.1, 0.82,
                 LIGHT_BLUE if j % 2 == 0 else WHITE)
        add_text(slide, "• " + pt, bx + 0.15, content_y + j*0.88 + 0.05,
                 3.8, 0.76, size=13.5, color=DARK_GRAY,
                 anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 4 — CRANIAL NERVES
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Cranial Nerve Examination", "CN I – XII")
footer(slide)

cn_data = [
    ("I",    "Olfactory",        "Smell — test with coffee/vanilla; rarely tested in infants"),
    ("II",   "Optic",            "Infants: fix & follow, red reflex | Older: Snellen, fundoscopy, visual fields"),
    ("III/IV/VI", "Oculo-motor", "Conjugate gaze, nystagmus, ptosis, pupil symmetry & reactivity"),
    ("V",    "Trigeminal",       "Facial sensation (3 divisions), corneal reflex, jaw movements"),
    ("VII",  "Facial",           "Symmetry at rest & with emotion (smile, raise eyebrows)"),
    ("VIII", "Vestibulocochlear","Infants: response/localization of sound | Older: finger rub, rinne/weber"),
    ("IX/X", "Glosso-pharyngeal/Vagus", "Phonation quality, swallowing, gag reflex; ask about feeding"),
    ("XI",   "Accessory",        "Shoulder shrug against resistance, head turning"),
    ("XII",  "Hypoglossal",      "Tongue protrusion, lateral movements; wasting/fasciculations"),
]

# Table layout
hdr_cols = [0.3, 1.5, 3.2, 6.7]
col_widths = [1.2, 1.7, 9.0]
yh = 1.28
add_rect(slide, 0.3, yh, 12.7, 0.44, DARK_BLUE)
for label, cx in zip(["CN", "Name", "Pediatric Test / Observation"],
                     [0.35, 1.55, 3.25]):
    add_text(slide, label, cx, yh + 0.03, 2.5, 0.38,
             size=13, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

for i, (cn, name, test) in enumerate(cn_data):
    y = yh + 0.44 + i * 0.58
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 0.3, y, 12.7, 0.56, bg)
    add_rect(slide, 0.3, y, 1.2, 0.56, MID_BLUE if i % 2 == 0 else RGBColor(0x21, 0x8B, 0xBD))
    add_text(slide, cn, 0.3, y + 0.02, 1.2, 0.52, size=14, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, name, 1.55, y + 0.04, 1.65, 0.48, size=12, bold=True,
             color=DARK_BLUE, anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, test, 3.25, y + 0.04, 9.8, 0.5, size=12,
             color=DARK_GRAY, anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 5 — MOTOR EXAMINATION
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Motor System Examination")
footer(slide)

# 4 cards in 2x2 grid
cards = [
    ("MUSCLE BULK", MID_BLUE, [
        "Inspect for atrophy (wasting)",
        "Pseudohypertrophy of calves → Duchenne MD",
        "Atrophy = red flag → refer",
    ]),
    ("MUSCLE TONE", ACCENT_TEAL, [
        "Spasticity (velocity-dependent ↑) — UMN",
        "Rigidity (lead-pipe/cogwheel) — extrapyramidal",
        "Hypotonia — LMN, cerebellar, metabolic",
        "Infants: Traction response, Axillary slip-through, Scarf sign, Ventral suspension",
        "Red flags: Scissoring, toe-walking, clasped thumb",
    ]),
    ("MUSCLE STRENGTH", RGBColor(0x6C, 0x35, 0x82), [
        "Infants/Toddlers: Rising from floor (Gower's), running, climbing",
        "Older: Confrontation testing, Pronator drift",
        "MRC Scale: 0=nil, 1=flicker, 2=gravity eliminated,",
        "  3=vs gravity, 4=vs resistance, 5=normal",
    ]),
    ("INVOLUNTARY MOVEMENTS", RGBColor(0xB7, 0x45, 0x0C), [
        "Fasciculations — LMN (anterior horn cell)",
        "Tics — repetitive, suppressible",
        "Dystonia — sustained abnormal posture",
        "Chorea — brief, random, dance-like",
        "Athetosis — slow, writhing",
        "Myoclonus — sudden brief jerks",
        "Tremor — rest / intention / postural",
    ]),
]

positions = [(0.3, 1.28), (6.85, 1.28), (0.3, 4.3), (6.85, 4.3)]
for (bx, by), (title, col, pts) in zip(positions, cards):
    bw, bh = 6.2, 2.9
    add_rect(slide, bx, by, bw, 0.42, col)
    add_text(slide, title, bx + 0.1, by + 0.02, bw - 0.2, 0.38,
             size=14, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide, bx, by + 0.42, bw, bh - 0.42, RGBColor(0xF0, 0xF8, 0xFF))
    add_multiline(slide, pts, bx + 0.15, by + 0.48, bw - 0.25,
                  bh - 0.52, size=13, color=DARK_GRAY, bullet=True)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 6 — REFLEXES
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Reflexes in Pediatric CNS Examination")
footer(slide)

# LEFT: Deep Tendon Reflexes
add_rect(slide, 0.3, 1.28, 5.9, 0.42, DARK_BLUE)
add_text(slide, "DEEP TENDON REFLEXES (DTRs)", 0.4, 1.28, 5.7, 0.42,
         size=14, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

dtr_data = [
    ("Biceps", "C5–C6"), ("Triceps", "C7"), ("Brachioradialis", "C5–C6"),
    ("Knee / Patellar", "L3–L4"), ("Ankle / Achilles", "S1–S2"),
]
for i, (reflex, level) in enumerate(dtr_data):
    y = 1.72 + i * 0.56
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 0.3, y, 5.9, 0.54, bg)
    add_text(slide, reflex, 0.4, y + 0.04, 3.5, 0.46, size=14, color=DARK_BLUE,
             bold=True, anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, level, 4.0, y + 0.04, 2.1, 0.46, size=14, color=MID_GRAY,
             anchor=MSO_ANCHOR.MIDDLE)

add_rect(slide, 0.3, 4.55, 5.9, 0.42, MID_BLUE)
add_text(slide, "GRADING SCALE", 0.4, 4.55, 5.7, 0.42,
         size=13, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
grades = ["0 = Absent", "1+ = Diminished", "2+ = Normal",
          "3+ = Brisk", "4+ = Clonus / Pathological"]
for i, g in enumerate(grades):
    y = 5.0 + i * 0.4
    col_bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 0.3, y, 5.9, 0.38, col_bg)
    add_text(slide, g, 0.45, y + 0.02, 5.7, 0.34, size=13,
             color=DARK_GRAY if i < 3 else RED, anchor=MSO_ANCHOR.MIDDLE)

# RIGHT: Primitive Reflexes
add_rect(slide, 6.9, 1.28, 6.1, 0.42, ACCENT_TEAL)
add_text(slide, "PRIMITIVE REFLEXES — Normal Disappearance", 7.0, 1.28, 6.0, 0.42,
         size=13, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

prim_data = [
    ("Moro",              "Birth",    "4–6 months"),
    ("Rooting",           "Birth",    "3–4 months"),
    ("Palmar Grasp",      "Birth",    "3–6 months"),
    ("Plantar Grasp",     "Birth",    "9–12 months"),
    ("ATNR",              "Birth",    "4–6 months"),
    ("Stepping",          "Birth",    "2–3 months"),
    ("Parachute",         "8–9 mo",   "Persists ✔"),
]
hdr_y = 1.72
add_rect(slide, 6.9, hdr_y, 6.1, 0.45, DARK_BLUE)
for label, cx, cw in zip(["Reflex", "Appears", "Disappears"],
                          [7.0, 10.1, 11.4], [2.9, 1.3, 1.5]):
    add_text(slide, label, cx, hdr_y + 0.03, cw, 0.39,
             size=12, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

for i, (name, appears, disapp) in enumerate(prim_data):
    y = 2.19 + i * 0.56
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 6.9, y, 6.1, 0.54, bg)
    text_col = LIME if "Persists" in disapp else (RED if i < 6 else MID_GRAY)
    add_text(slide, name, 7.0, y + 0.04, 3.0, 0.46, size=13,
             bold=True, color=DARK_BLUE, anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, appears, 10.1, y + 0.04, 1.2, 0.46, size=12,
             color=MID_GRAY, anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, disapp, 11.35, y + 0.04, 1.55, 0.46, size=12,
             bold=("Persists" in disapp), color=text_col, anchor=MSO_ANCHOR.MIDDLE)

add_rect(slide, 6.9, 6.1, 6.1, 0.95, RGBColor(0xFF, 0xF0, 0xF0))
add_text(slide, "⚠ Persistence of primitive reflexes beyond expected age\n    suggests cerebral palsy or UMN pathology",
         7.0, 6.12, 5.9, 0.9, size=13, bold=True,
         color=RED, anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 7 — COORDINATION & SENSORY
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Coordination & Sensory Examination")
footer(slide)

# LEFT — Coordination
add_rect(slide, 0.3, 1.28, 6.0, 0.42, ACCENT_TEAL)
add_text(slide, "COORDINATION (CEREBELLAR)", 0.4, 1.28, 5.8, 0.42,
         size=15, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

coord_pts = [
    ("Finger-Nose-Finger Test", "Dysmetria → cerebellar lesion"),
    ("Heel-Knee-Shin Test", "Ataxia of lower limb"),
    ("Rapid Alternating Movements", "Dysdiadochokinesia → cerebellar"),
    ("Romberg Test", "Positive = proprioceptive/cerebellar deficit"),
    ("Infants equivalent", "Watch reach & grasp for tremor or overshooting"),
    ("Tandem (heel-to-toe) walking", "Sensitive cerebellar screen"),
]
for i, (test, meaning) in enumerate(coord_pts):
    y = 1.72 + i * 0.82
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 0.3, y, 6.0, 0.78, bg)
    add_text(slide, test, 0.45, y + 0.03, 5.7, 0.34,
             size=13, bold=True, color=DARK_BLUE, anchor=MSO_ANCHOR.TOP)
    add_text(slide, meaning, 0.45, y + 0.35, 5.7, 0.38,
             size=12, color=MID_GRAY, anchor=MSO_ANCHOR.TOP)

# RIGHT — Sensory
add_rect(slide, 7.0, 1.28, 6.0, 0.42, MID_BLUE)
add_text(slide, "SENSORY EXAMINATION", 7.1, 1.28, 5.8, 0.42,
         size=15, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

add_rect(slide, 7.0, 1.72, 6.0, 0.38, RGBColor(0xD5, 0xE8, 0xD4))
add_text(slide, "PRIMARY MODALITIES", 7.1, 1.72, 5.8, 0.36,
         size=13, bold=True, color=LIME, anchor=MSO_ANCHOR.MIDDLE)
primary = ["Light touch", "Pin-prick (pain)", "Temperature",
           "Vibration (128 Hz tuning fork)", "Joint position sense (proprioception)"]
for i, p in enumerate(primary):
    y = 2.12 + i * 0.42
    add_rect(slide, 7.0, y, 6.0, 0.4, LIGHT_BLUE if i % 2 == 0 else WHITE)
    add_text(slide, "• " + p, 7.15, y + 0.04, 5.7, 0.34,
             size=13, color=DARK_GRAY, anchor=MSO_ANCHOR.MIDDLE)

add_rect(slide, 7.0, 4.25, 6.0, 0.38, RGBColor(0xD6, 0xEA, 0xF8))
add_text(slide, "CORTICAL / HIGHER MODALITIES", 7.1, 4.25, 5.8, 0.36,
         size=13, bold=True, color=MID_BLUE, anchor=MSO_ANCHOR.MIDDLE)
cortical = ["Graphesthesia (number written on palm)",
            "Stereognosis (identify object by touch)",
            "Two-point discrimination",
            "Sensory extinction (double simultaneous stimulation)"]
for i, p in enumerate(cortical):
    y = 4.65 + i * 0.44
    add_rect(slide, 7.0, y, 6.0, 0.42, LIGHT_BLUE if i % 2 == 0 else WHITE)
    add_text(slide, "• " + p, 7.15, y + 0.04, 5.7, 0.36,
             size=12.5, color=DARK_GRAY, anchor=MSO_ANCHOR.MIDDLE)

add_rect(slide, 7.0, 6.45, 6.0, 0.6, RGBColor(0xFF, 0xF3, 0xCD))
add_text(slide, "⚠ In young children: Use withdrawal response\n  and facial expressions to assess pain / touch",
         7.1, 6.47, 5.8, 0.56, size=12.5, bold=True,
         color=RGBColor(0x85, 0x64, 0x04), anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 8 — GAIT
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Gait Analysis in Pediatrics")
footer(slide)

gait_data = [
    (DARK_BLUE,   "Hemiplegic Gait",    "Arm flexed + leg circumduction",       "Spastic hemiplegia (UMN lesion)"),
    (MID_BLUE,    "Scissor Gait",       "Legs cross midline, hip adductor spasm","Spastic diplegia (CP)"),
    (ACCENT_TEAL, "Waddling Gait",      "Side-to-side trunk sway",               "Proximal myopathy (Duchenne MD)"),
    (RGBColor(0x6C,0x35,0x82), "Steppage Gait", "High stepping, foot slap",    "Foot drop (peripheral neuropathy)"),
    (RGBColor(0xB7,0x45,0x0C), "Ataxic Gait",  "Wide-based, unsteady, lurching","Cerebellar disease"),
    (RGBColor(0x11,0x7A,0x65), "Toe Walking",  "Persistent bilateral toe walking","Spastic CP, autism, habitual"),
    (RGBColor(0x78,0x28,0x8A), "Trendelenburg","Contralateral hip dip on stance", "Hip abductor weakness / DDH"),
]

for i, (col, name, description, cause) in enumerate(gait_data):
    row = i // 2
    ci = i % 2
    bx = 0.3 + ci * 6.55
    by = 1.28 + row * 1.85
    if i == 6:
        bx = 3.55
    bw = 6.2
    add_rect(slide, bx, by, bw, 0.42, col)
    add_text(slide, name, bx + 0.1, by + 0.02, bw - 0.2, 0.38,
             size=15, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
    add_rect(slide, bx, by + 0.42, bw, 1.28, RGBColor(0xF0, 0xF8, 0xFF))
    add_text(slide, "How: " + description,
             bx + 0.15, by + 0.46, bw - 0.25, 0.56,
             size=12.5, color=DARK_GRAY, anchor=MSO_ANCHOR.TOP)
    add_text(slide, "Cause: " + cause,
             bx + 0.15, by + 1.0, bw - 0.25, 0.62,
             size=12.5, bold=True, color=col, anchor=MSO_ANCHOR.TOP)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 9 — HEAD CIRCUMFERENCE & FONTANELLE
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Head Circumference & Fontanelle")
footer(slide)

# Left — HC
add_rect(slide, 0.3, 1.28, 6.0, 0.42, DARK_BLUE)
add_text(slide, "HEAD CIRCUMFERENCE (OFC)", 0.4, 1.28, 5.8, 0.42,
         size=15, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
add_rect(slide, 0.3, 1.72, 6.0, 0.38, RGBColor(0xD5, 0xE8, 0xD4))
add_text(slide, "Measurement: Occipitofrontal Circumference — plot on growth chart",
         0.4, 1.73, 5.8, 0.36, size=12.5, color=DARK_GRAY, anchor=MSO_ANCHOR.MIDDLE)

hc_pts = [
    ("Normal at birth", "~34 cm"),
    ("Normal at 1 year", "~47 cm"),
    ("Normal at 2 years", "~49 cm"),
    ("Macrocephaly", ">98th percentile → Hydrocephalus, megalencephaly, subdural"),
    ("Microcephaly", "<2nd percentile → TORCH, genetic, HIE"),
]
for i, (label, val) in enumerate(hc_pts):
    y = 2.12 + i * 0.78
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 0.3, y, 6.0, 0.72, bg)
    add_text(slide, label, 0.45, y + 0.04, 3.3, 0.32,
             size=13, bold=True, color=DARK_BLUE, anchor=MSO_ANCHOR.TOP)
    add_text(slide, val, 0.45, y + 0.34, 5.7, 0.36,
             size=12.5, color=DARK_GRAY, anchor=MSO_ANCHOR.TOP)

# Right — Fontanelle
add_rect(slide, 7.0, 1.28, 6.0, 0.42, ACCENT_TEAL)
add_text(slide, "FONTANELLE EXAMINATION", 7.1, 1.28, 5.8, 0.42,
         size=15, bold=True, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

font_data = [
    ("Anterior Fontanelle", "Diamond shape; closes 9–18 months"),
    ("Posterior Fontanelle", "Triangle shape; closes 6–8 weeks"),
    ("Bulging Fontanelle", "↑ Intracranial pressure (meningitis, hydrocephalus, bleed)"),
    ("Sunken Fontanelle", "Dehydration"),
    ("Late closure (>18 mo)", "Hypothyroidism, rickets, trisomy 21"),
    ("Early closure", "Craniosynostosis → requires imaging"),
]
for i, (f, desc) in enumerate(font_data):
    y = 1.72 + i * 0.85
    bg = LIGHT_BLUE if i % 2 == 0 else WHITE
    add_rect(slide, 7.0, y, 6.0, 0.82, bg)
    add_text(slide, f, 7.15, y + 0.03, 5.7, 0.34,
             size=13, bold=True, color=DARK_BLUE, anchor=MSO_ANCHOR.TOP)
    add_text(slide, desc, 7.15, y + 0.36, 5.7, 0.42,
             size=12.5, color=DARK_GRAY, anchor=MSO_ANCHOR.TOP)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 10 — RED FLAGS
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Red Flags in Pediatric CNS Examination",
           "Refer for urgent neurological evaluation")
footer(slide)

red_flags = [
    "Loss / regression of previously acquired developmental milestones",
    "Focal neurological deficit — asymmetric reflexes, weakness, cranial nerve palsy",
    "Persistent Babinski sign beyond 18 months",
    "Persistence of primitive reflexes beyond expected age",
    "Macrocephaly with rapidly increasing head circumference",
    "Papilledema (sign of raised intracranial pressure)",
    "Early hand dominance (<12 months) — suggests contralateral UMN lesion",
    "Ataxia + head tilt → posterior fossa mass until proven otherwise",
    "Nystagmus — especially vertical or see-saw pattern",
    "Spasticity, scissoring, persistent toe-walking",
    "Sudden onset encephalopathy / altered consciousness",
    "Unexplained failure to thrive with hypotonia",
]

cols_rf = [red_flags[:6], red_flags[6:]]
col_x = [0.3, 6.85]
for ci, col_flags in enumerate(cols_rf):
    bx = col_x[ci]
    for i, flag in enumerate(col_flags):
        y = 1.28 + i * 0.96
        add_rect(slide, bx, y, 6.15, 0.88, RGBColor(0xFF, 0xEE, 0xEE))
        add_rect(slide, bx, y, 0.45, 0.88, RED)
        add_text(slide, "!", bx, y, 0.45, 0.88, size=22, bold=True,
                 color=WHITE, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
        add_text(slide, flag, bx + 0.5, y + 0.05, 5.5, 0.76,
                 size=12.5, color=DARK_GRAY, anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 11 — AGE-WISE APPROACH
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF8, 0xFD))
header_bar(slide, "Age-Wise CNS Examination Approach")
footer(slide)

age_data = [
    (DARK_BLUE,    "NEONATE\n(0–1 month)",
     ["Tone — ventral suspension, traction response",
      "Primitive reflexes — Moro, rooting, grasp, ATNR",
      "Cry quality and feeding",
      "Fontanelle and OFC",
      "Pupillary response, red reflex"]),
    (MID_BLUE,     "INFANT\n(1–12 months)",
     ["Milestone tracking (social smile by 6 wk, sit by 6 mo)",
      "Fix and follow (by 6–8 wk)",
      "Head control — emerges by 4 months",
      "Disappearance of primitive reflexes",
      "Parachute reflex appears ~9 months"]),
    (ACCENT_TEAL,  "TODDLER\n(1–3 years)",
     ["Observe gait — walking by 12–15 months",
      "Language milestones — words, phrases",
      "Hand dominance — early dominance = red flag",
      "Play behaviour — symbolic play",
      "Engage with toys for co-operation"]),
    (RGBColor(0x6C, 0x35, 0x82), "SCHOOL AGE\n(5–12 years)",
     ["Full formal neurological exam possible",
      "Coordination, gait, tandem walking",
      "Learning difficulties, attention, behaviour",
      "Standardized cognitive screening",
      "Detailed cranial nerve and motor exam"]),
    (RGBColor(0x11, 0x7A, 0x65), "ADOLESCENT\n(>12 years)",
     ["Adult-style complete CNS exam",
      "Screen for depression, substance use",
      "Higher cognitive functions",
      "Functional neurological symptoms",
      "Headache evaluation (PHYSICAL + NEURO)"]),
]

bw = 2.46
for i, (col, title, pts) in enumerate(age_data):
    bx = 0.25 + i * 2.62
    by = 1.28
    add_rect(slide, bx, by, bw, 0.9, col)
    add_text(slide, title, bx + 0.07, by + 0.04, bw - 0.14, 0.82,
             size=13.5, bold=True, color=WHITE,
             align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
    for j, pt in enumerate(pts):
        y = by + 0.92 + j * 0.98
        bg = LIGHT_BLUE if j % 2 == 0 else WHITE
        add_rect(slide, bx, y, bw, 0.95, bg)
        add_text(slide, "• " + pt, bx + 0.1, y + 0.06, bw - 0.15, 0.85,
                 size=11.5, color=DARK_GRAY, anchor=MSO_ANCHOR.MIDDLE)

# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE 12 — SUMMARY / REFERENCE
# ══════════════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE)
add_rect(slide, 0, 5.8, 13.333, 1.7, MID_BLUE)
add_rect(slide, 0, 7.1, 13.333, 0.4, ACCENT_TEAL)

add_text(slide, "Key Take-Aways", 0.5, 0.4, 12.3, 0.9,
         size=36, bold=True, color=YELLOW,
         align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)

summary_pts = [
    "Observe FIRST — most information in children comes from observation before formal testing",
    "Always ADAPT the exam to developmental age — no single approach fits all",
    "Plot head circumference on EVERY visit in the first 2 years",
    "Primitive reflexes have a predictable timeline — persistence = red flag",
    "Pronator drift and Gower's sign are simple, high-yield bedside tools",
    "Early referral is warranted for ANY developmental regression or focal deficit",
]
for i, pt in enumerate(summary_pts):
    y = 1.38 + i * 0.7
    add_rect(slide, 0.5, y, 0.45, 0.55, ACCENT_TEAL)
    add_text(slide, str(i+1), 0.5, y, 0.45, 0.55, size=16, bold=True,
             color=WHITE, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
    add_text(slide, pt, 1.05, y + 0.03, 11.8, 0.5,
             size=15, color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

add_text(slide, "Reference: Santhosh Kumar — Pediatric Clinical Methods",
         0.5, 5.9, 12.3, 0.5, size=18, bold=True,
         color=YELLOW, align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
add_text(slide, "Harriet Lane Handbook 23e  |  Bradley & Daroff's Neurology  |  Standard Pediatric Clinical Methods",
         0.5, 6.45, 12.3, 0.45, size=13, color=WHITE,
         align=PP_ALIGN.CENTER)

# ─── SAVE ─────────────────────────────────────────────────────────────────────
out = "/tmp/workspace/cns-peds-ppt/CNS_Examination_Pediatrics.pptx"
buf = BytesIO()
prs.save(buf)
with open(out, "wb") as f:
    f.write(buf.getvalue())
print(f"Saved: {out}")
Running Command

cd /tmp/workspace/cns-peds-ppt && python create_ppt.py

Running Command

python -c " from pptx import Presentation prs = Presentation('/tmp/workspace/cns-peds-ppt/CNS_Examination_Pediatrics.pptx') print(f'Slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): texts = [s.text_frame.text[:60] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] print(f' Slide {i}: {texts[0] if texts else \"(no text)\"}') "

Your presentation is ready!

CNS Examination Pediatrics

Presentation · PPTX


12 slides included:
#Slide
1Title Slide — CNS Examination in Pediatrics
2Overview / Outline (9 topics)
3Mental Status — Age-adapted approach (Neonate → Adolescent)
4Cranial Nerves CN I–XII — Table with pediatric-specific tests
5Motor System — Bulk, Tone, Strength, Involuntary Movements
6Reflexes — DTRs + Grading Scale + Primitive Reflexes with disappearance timeline
7Coordination (Cerebellar tests) + Sensory Examination
8Gait Analysis — 7 gait patterns with causes
9Head Circumference & Fontanelle
10Red Flags — 12 warning signs (each highlighted in red)
11Age-Wise Approach — 5 age bands (Neonate to Adolescent)
12Summary / Key Take-Aways + Reference
Reference credited on every slide: Santhosh Kumar — Pediatric Clinical Methods, with Harriet Lane Handbook 23e and Bradley & Daroff's Neurology as supporting sources.

Pediatrics cns only in detail

Asking for Preferences
Reading File
Writing File

~/cns-peds-ppt/create_detailed_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from io import BytesIO

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)

# ── PALETTE ──────────────────────────────────────────────────────────────────
NAVY        = RGBColor(0x0A, 0x3D, 0x62)
COBALT      = RGBColor(0x13, 0x6C, 0xB0)
SKY         = RGBColor(0xD6, 0xEA, 0xF8)
TEAL        = RGBColor(0x00, 0x87, 0x87)
MINT        = RGBColor(0xD5, 0xF5, 0xE3)
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
OFFWHITE    = RGBColor(0xF4, 0xF8, 0xFD)
DARK        = RGBColor(0x1C, 0x1C, 0x1C)
GRAY        = RGBColor(0x50, 0x50, 0x50)
LGRAY       = RGBColor(0xEC, 0xF0, 0xF1)
RED         = RGBColor(0xC0, 0x39, 0x2B)
ORANGE      = RGBColor(0xD3, 0x54, 0x00)
YELLOW      = RGBColor(0xFF, 0xBF, 0x00)
GREEN       = RGBColor(0x1E, 0x8B, 0x4C)
PURPLE      = RGBColor(0x6C, 0x35, 0x82)
LRED        = RGBColor(0xFF, 0xEB, 0xEB)
LORANGE     = RGBColor(0xFF, 0xF3, 0xE0)
blank       = prs.slide_layouts[6]

# ── HELPERS ───────────────────────────────────────────────────────────────────
def rect(slide, x, y, w, h, clr, line=False):
    s = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
    s.fill.solid(); s.fill.fore_color.rgb = clr
    if line: s.line.color.rgb = clr
    else: s.line.fill.background()
    return s

def txt(slide, text, x, y, w, h, size=14, bold=False, italic=False,
        color=DARK, align=PP_ALIGN.LEFT, anchor=MSO_ANCHOR.TOP, wrap=True, name="Calibri"):
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame; tf.word_wrap = wrap; tf.vertical_anchor = anchor
    tf.margin_left = Pt(3); tf.margin_right = Pt(3)
    tf.margin_top  = Pt(2); tf.margin_bottom= Pt(2)
    p = tf.paragraphs[0]; p.alignment = align
    r = p.add_run(); r.text = text
    r.font.size = Pt(size); r.font.bold = bold; r.font.italic = italic
    r.font.color.rgb = color; r.font.name = name
    return tf

def mltxt(slide, lines, x, y, w, h, size=13, color=DARK, hdr_color=None, wrap=True):
    """lines: list of str or (str, bold, color_override)"""
    tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = tb.text_frame; tf.word_wrap = wrap
    tf.margin_left = Pt(3); tf.margin_right = Pt(3)
    tf.margin_top  = Pt(2); tf.margin_bottom= Pt(2)
    for i, line in enumerate(lines):
        if   isinstance(line, tuple) and len(line)==3: text, bld, clr = line
        elif isinstance(line, tuple) and len(line)==2: text, bld = line; clr = color
        else: text, bld, clr = line, False, color
        p = tf.paragraphs[0] if i==0 else tf.add_paragraph()
        p.alignment = PP_ALIGN.LEFT
        r = p.add_run(); r.text = text
        r.font.size = Pt(size); r.font.bold = bld
        r.font.color.rgb = clr if clr else color
        r.font.name = "Calibri"
    return tf

def header(slide, title, sub=None, clr=NAVY):
    rect(slide, 0, 0, 13.333, 1.05, clr)
    rect(slide, 0, 1.05, 13.333, 0.07, TEAL)
    txt(slide, title, 0.3, 0.07, 12.5, 0.78, size=32, bold=True,
        color=WHITE, align=PP_ALIGN.LEFT, anchor=MSO_ANCHOR.MIDDLE)
    if sub:
        txt(slide, sub, 0.3, 0.72, 12.5, 0.36, size=14,
            color=SKY, align=PP_ALIGN.LEFT)

def footer(slide):
    rect(slide, 0, 7.15, 13.333, 0.35, NAVY)
    txt(slide, "Reference: Santhosh Kumar – Pediatric Clinical Methods  |  Harriet Lane Handbook 23e",
        0.3, 7.17, 12.5, 0.3, size=10.5, color=SKY, align=PP_ALIGN.LEFT)

def section_hdr(slide, title, x, y, w, h=0.42, clr=COBALT):
    rect(slide, x, y, w, h, clr)
    txt(slide, title, x+0.08, y+0.02, w-0.16, h-0.04, size=14, bold=True,
        color=WHITE, anchor=MSO_ANCHOR.MIDDLE)

def bullet_box(slide, pts, x, y, w, h, size=13, bg=OFFWHITE, color=DARK, bullet="•"):
    rect(slide, x, y, w, h, bg)
    lines = [(bullet+" "+p if not p.startswith("→") and not p.startswith("  ") else p, False, color) for p in pts]
    mltxt(slide, lines, x+0.1, y+0.04, w-0.18, h-0.08, size=size, color=color)

def two_col_bullets(slide, left_title, left_pts, right_title, right_pts,
                    left_clr=COBALT, right_clr=TEAL, ystart=1.18, size=13):
    section_hdr(slide, left_title,  0.25, ystart, 6.35, clr=left_clr)
    section_hdr(slide, right_title, 6.85, ystart, 6.2,  clr=right_clr)
    lh = (7.0 - ystart - 0.6) / max(len(left_pts),1)
    rh = (7.0 - ystart - 0.6) / max(len(right_pts),1)
    row_h = min(lh, rh, 0.72)
    for i, pt in enumerate(left_pts):
        yy = ystart+0.44+i*row_h
        rect(slide, 0.25, yy, 6.35, row_h-0.04, SKY if i%2==0 else WHITE)
        txt(slide,"• "+pt, 0.38, yy+0.04, 6.1, row_h-0.1, size=size, color=DARK, anchor=MSO_ANCHOR.MIDDLE)
    for i, pt in enumerate(right_pts):
        yy = ystart+0.44+i*row_h
        rect(slide, 6.85, yy, 6.2, row_h-0.04, MINT if i%2==0 else WHITE)
        txt(slide,"• "+pt, 6.98, yy+0.04, 5.95, row_h-0.1, size=size, color=DARK, anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 1 — TITLE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s, 0,0, 13.333,7.5, NAVY)
rect(s, 0,5.6, 13.333,1.9, COBALT)
rect(s, 0,7.05, 13.333,0.45, TEAL)

txt(s,"CNS EXAMINATION",      0.5,0.7, 12.3,1.5, size=56,bold=True,color=WHITE,
    align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
txt(s,"IN PEDIATRICS",        0.5,2.1, 12.3,1.0, size=44,bold=True,color=YELLOW,
    align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
txt(s,"A Detailed Systematic Clinical Approach",
    0.5,3.1,12.3,0.65, size=22, color=SKY, align=PP_ALIGN.CENTER)

rect(s, 3.5,3.9, 6.333,0.06, TEAL)

txt(s,"Reference: Santhosh Kumar – Pediatric Clinical Methods",
    0.5,4.1, 12.3,0.5, size=17, bold=True, color=YELLOW, align=PP_ALIGN.CENTER)
txt(s,"Harriet Lane Handbook 23e  |  Bradley & Daroff's Neurology",
    0.5,4.6, 12.3,0.4, size=14, color=SKY, align=PP_ALIGN.CENTER)
txt(s,"Pediatrics  •  Neurology  •  Clinical Examination",
    0.5,7.08,12.3,0.38, size=12, color=WHITE, align=PP_ALIGN.CENTER)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 2 — TABLE OF CONTENTS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Contents — Pediatric CNS Examination")
footer(s)

topics = [
    ("01","Mental Status & Developmental Milestones"),
    ("02","Cranial Nerve I — Olfactory"),
    ("03","Cranial Nerves II — Optic & Visual System"),
    ("04","Cranial Nerves III, IV, VI — Eye Movements"),
    ("05","Cranial Nerve V — Trigeminal"),
    ("06","Cranial Nerve VII — Facial"),
    ("07","Cranial Nerves VIII, IX, X, XI, XII"),
    ("08","Motor — Muscle Bulk & Tone"),
    ("09","Motor — Tone in Infants (Detailed)"),
    ("10","Motor — Strength & MRC Grading"),
    ("11","Involuntary Movements"),
    ("12","Deep Tendon Reflexes"),
    ("13","Primitive Reflexes (Detailed)"),
    ("14","Superficial & Pathological Reflexes"),
    ("15","Coordination & Cerebellar Tests"),
    ("16","Gait Analysis (7 Types)"),
    ("17","Sensory Examination"),
    ("18","Head Circumference & Fontanelle"),
    ("19","Developmental Milestones — Motor"),
    ("20","Developmental Milestones — Language & Social"),
    ("21","Red Flags & Urgency Guide"),
    ("22","Age-Wise Approach Summary"),
    ("23","Key Take-Aways"),
]
col1 = topics[:12]; col2 = topics[12:]
for ci, col in enumerate([col1, col2]):
    bx = 0.3+ci*6.55
    for i,(num,topic) in enumerate(col):
        yy = 1.22+i*0.47
        rect(s, bx, yy, 0.55, 0.43, COBALT if ci==0 else TEAL)
        txt(s, num, bx, yy, 0.55, 0.43, size=12, bold=True, color=WHITE,
            align=PP_ALIGN.CENTER, anchor=MSO_ANCHOR.MIDDLE)
        rect(s, bx+0.55, yy, 5.65, 0.43, SKY if i%2==0 else WHITE)
        txt(s, topic, bx+0.65, yy+0.03, 5.45, 0.38, size=13,
            color=NAVY, anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 3 — MENTAL STATUS (detailed)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Mental Status Examination","Alertness • Orientation • Language • Cognition • Behaviour")
footer(s)

ms_domains = [
    ("ALERTNESS",     NAVY,   ["Open eyes spontaneously?","Response to voice/pain?",
                                "GCS adapted for age — eyes, verbal, motor"]),
    ("ORIENTATION",   COBALT, ["Person (name, age)","Place: Where are you?",
                                "Time: Day/season/year (>5 yr)","Situation: Why here?"]),
    ("LANGUAGE",      TEAL,   ["Fluency — rate, rhythm, effort","Comprehension — follow commands",
                                "Repetition — repeat a sentence","Naming — objects",
                                "Dysarthria vs Aphasia"]),
    ("COGNITION",     PURPLE, ["Memory — short-term (3-object recall)",
                                "Attention — digit span, serial 7s (>8 yr)",
                                "Calculation — simple sums","Abstract reasoning"]),
    ("BEHAVIOUR",     RGBColor(0x17,0x6B,0x87),
                              ["Eye contact & social interaction","Hyperactivity / distractibility",
                                "Affect — flat, labile, appropriate","Cooperation with exam"]),
]

bw, bh = 2.52, 5.7
for i,(title,clr,pts) in enumerate(ms_domains):
    bx = 0.22 + i*2.62
    rect(s, bx, 1.22, bw, 0.46, clr)
    txt(s, title, bx+0.06, 1.22, bw-0.12, 0.46, size=13, bold=True,
        color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
    for j,pt in enumerate(pts):
        yy = 1.7+j*0.9
        rect(s, bx, yy, bw, 0.86, SKY if j%2==0 else WHITE)
        txt(s,"• "+pt, bx+0.1, yy+0.06, bw-0.18, 0.76, size=12.5, color=DARK,
            anchor=MSO_ANCHOR.MIDDLE)

# AGE tips strip at bottom
rect(s,0.22,6.6,12.8,0.46, LORANGE)
txt(s,"Age tips → Infants: 'cuteness', engagement  |  Toddlers: Bring toys, observe play  |  "
      "School: Draw, describe friends  |  Adolescents: HEADSS screen",
    0.35,6.62,12.5,0.4, size=12, bold=True, color=ORANGE,
    align=PP_ALIGN.LEFT, anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 4 — CRANIAL NERVE I
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Cranial Nerve I — Olfactory","Smell")
footer(s)

section_hdr(s,"ANATOMY & PATHWAY", 0.3,1.22,5.9, clr=NAVY)
anat = ["Olfactory receptor neurons in nasal mucosa",
        "Fibres pass through cribriform plate of ethmoid",
        "Synapse in olfactory bulb → olfactory tract",
        "Project to primary olfactory cortex (piriform cortex)",
        "Connections to limbic system (memory, emotion)"]
bullet_box(s, anat, 0.3,1.66,5.9,2.5, size=13, bg=SKY)

section_hdr(s,"HOW TO TEST IN CHILDREN", 0.3,4.24,5.9, clr=COBALT)
test = ["Use familiar non-irritant scents: coffee, vanilla, peppermint, chocolate",
        "Test each nostril separately (occlude the other)",
        "Infants: watch for facial change / withdrawal response",
        "Older: ask to identify substance with eyes closed",
        "Avoid ammonia / alcohol — stimulates trigeminal (CN V)"]
bullet_box(s, test, 0.3,4.68,5.9,2.38, size=13, bg=MINT)

section_hdr(s,"WHEN TO TEST & CLINICAL SIGNIFICANCE", 6.85,1.22,6.2, clr=TEAL)
clin = ["When to test: Head trauma, anterior cranial fossa lesion,",
        "  suspected Kallmann syndrome, neurofibromatosis",
        "Anosmia → Olfactory groove meningioma, frontal lobe lesion",
        "Anosmia in adolescents → consider Kallmann syndrome",
        "  (anosmia + hypogonadism)"]
bullet_box(s, clin, 6.85,1.66,6.2,2.5, size=13, bg=SKY)

section_hdr(s,"ABNORMALITIES", 6.85,4.24,6.2, clr=PURPLE)
abn = ["Anosmia — complete loss of smell",
       "Hyposmia — reduced smell",
       "Parosmia — distorted smell perception",
       "Hyperosmia — heightened smell (migraines)"]
bullet_box(s, abn, 6.85,4.68,6.2,2.38, size=13, bg=LRED)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 5 — CN II — VISUAL SYSTEM
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Cranial Nerve II — Optic Nerve & Visual System")
footer(s)

# 4 sub-boxes
boxes = [
    ("VISUAL ACUITY", NAVY,
     ["Infants: Fix and follow (bright object/face)",
      "Fix & follow by 6–8 weeks — red flag if absent",
      "Preferential looking / Cardiff cards (6 mo–3 yr)",
      "Illiterate E-chart / Sheridan-Gardiner (3–5 yr)",
      "Snellen chart (≥5 yr) — test each eye separately",
      "Normal adult acuity 6/6 (20/20)"]),
    ("VISUAL FIELDS", COBALT,
     ["Confrontation method — compare examiner's field",
      "Infants: Draw attention to midline, then periphery",
      "Toddlers: 'Where is the toy?' technique",
      "Older: Wiggle finger in each quadrant",
      "Hemianopia = lesion post chiasm",
      "Bitemporal = chiasm compression (e.g. craniopharyngioma)"]),
    ("PUPILLARY REFLEXES", TEAL,
     ["Direct light reflex — CN II afferent, CN III efferent",
      "Consensual reflex — bilateral",
      "RAPD (Relative Afferent Pupillary Defect) = swinging flashlight test",
      "RAPD positive → optic nerve or severe retinal disease",
      "Accommodation reflex: near object → miosis + convergence"]),
    ("FUNDOSCOPY", GREEN,
     ["Red reflex: absent → cataract, retinoblastoma, corneal opacification",
      "Papilledema: disc edema, blurred margins, haemorrhages → ↑ICP",
      "Optic atrophy: pale disc → old papilledema, ON damage",
      "Cherry-red spot: GM1/GM2 gangliosidosis, Niemann-Pick",
      "Retinal haemorrhages: NAI (non-accidental injury)"]),
]

positions = [(0.25,1.22),(6.8,1.22),(0.25,4.2),(6.8,4.2)]
for (bx,by),(title,clr,pts) in zip(positions, boxes):
    bw2,bh2 = 6.2,2.82
    rect(s, bx,by,bw2,0.42, clr)
    txt(s, title, bx+0.1,by+0.02, bw2-0.18,0.38, size=14,bold=True,
        color=WHITE, anchor=MSO_ANCHOR.MIDDLE)
    for i,pt in enumerate(pts):
        yy = by+0.44+i*0.39
        rect(s, bx,yy,bw2,0.37, SKY if i%2==0 else WHITE)
        txt(s,"• "+pt, bx+0.12,yy+0.03, bw2-0.2,0.32, size=12, color=DARK, anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 6 — CN III, IV, VI — Eye Movements
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Cranial Nerves III, IV, VI — Eye Movements","Oculomotor • Trochlear • Abducens")
footer(s)

# CN table
section_hdr(s,"NERVE FUNCTIONS", 0.25,1.22,12.8, clr=NAVY)
cn_rows = [
    ("III Oculomotor","SR, IR, MR, IO muscles + levator palpebrae","Eyelid elevation, adduction, elevation of eye + pupil constriction (parasympathetic)"),
    ("IV Trochlear","Superior Oblique","Depression + intorsion — defect: head tilt, vertical diplopia going downstairs"),
    ("VI Abducens","Lateral Rectus","Abduction of eye — most common CN palsy in children (↑ICP, Gradenigo)"),
]
hdr_y = 1.66
rect(s,0.25,hdr_y,12.8,0.4, COBALT)
for label,cx,cw in zip(["Nerve","Muscle","Clinical significance"],[0.35,2.5,6.0],[2.1,3.4,7.0]):
    txt(s,label,cx,hdr_y+0.03,cw,0.34,size=13,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(cn,muscle,sig) in enumerate(cn_rows):
    yy=2.08+i*0.62
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.6,bg)
    rect(s,0.25,yy,2.12,0.6,COBALT if i%2==0 else RGBColor(0x21,0x8B,0xBD))
    txt(s,cn,0.35,yy+0.04,1.98,0.52,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,muscle,2.52,yy+0.04,3.3,0.52,size=12,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sig,6.05,yy+0.04,6.8,0.52,size=12,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# How to test
section_hdr(s,"HOW TO EXAMINE EYE MOVEMENTS", 0.25,3.98,6.2, clr=TEAL)
test_em = ["Use H-pattern or cross pattern (9 positions of gaze)",
           "Infants: follow a bright toy or light — assess smooth pursuit",
           "Look for nystagmus (direction, fast phase), ptosis, squint",
           "Cover-uncover test — detects latent squint (phoria)",
           "Hirschberg corneal light reflex — for strabismus",
           "Pupils: PERLA (Pupils Equal Round Reactive to Light + Accommodation)"]
bullet_box(s,test_em,0.25,4.42,6.2,2.48,size=13,bg=SKY)

section_hdr(s,"PALSIES — CLINICAL FEATURES", 6.7,3.98,6.4, clr=RED)
palsies = ["CN III palsy: ptosis + 'down-and-out' eye + fixed dilated pupil",
           "Surgical CN III: pupil INVOLVED (posterior communicating artery aneurysm)",
           "Medical CN III: pupil SPARED (DM, ischaemia)",
           "CN IV palsy: vertical diplopia worse going downstairs, head tilt",
           "CN VI palsy: esotropia (eye turned in), horizontal diplopia",
           "Internuclear ophthalmoplegia (INO): MS, brainstem lesion"]
bullet_box(s,palsies,6.7,4.42,6.4,2.48,size=12.5,bg=LRED)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 7 — CN V, VII
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Cranial Nerves V & VII — Trigeminal & Facial")
footer(s)

two_col_bullets(s,
    "CN V — TRIGEMINAL (Motor + Sensory)",
    ["3 divisions: V1 Ophthalmic, V2 Maxillary, V3 Mandibular",
     "Sensory: touch, pain, temperature of face & scalp",
     "Motor: muscles of mastication (masseter, temporalis, pterygoids)",
     "Test sensory: cotton wool + pin in all 3 divisions bilaterally",
     "Test motor: clench teeth → palpate masseter; jaw deviation to weak side",
     "Corneal reflex: CN V afferent → CN VII efferent (blink)",
     "Jaw jerk: ↑ in pseudobulbar palsy",
     "Trigeminal neuralgia: lancinating pain in adolescents (rare)"],
    "CN VII — FACIAL (Motor + Taste + Autonomic)",
    ["UMN (central) lesion: lower face only affected (forehead spared)",
     "LMN (peripheral) lesion: ALL facial muscles (forehead involved)",
     "Bell's palsy: most common cause of unilateral facial palsy in children",
     "Test: raise eyebrows, close eyes tight, puff cheeks, show teeth, smile",
     "Taste: anterior 2/3 tongue (chorda tympani — branch of VII)",
     "Test taste with sweet/salt on each side of anterior tongue",
     "Hyperacusis: intolerance to sound → lesion above nerve to stapedius",
     "Ramsay Hunt: herpes zoster oticus + facial palsy + vesicles in ear"],
    left_clr=COBALT, right_clr=TEAL, ystart=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 8 — CN VIII, IX, X, XI, XII
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Cranial Nerves VIII – XII","Vestibulocochlear • Glossopharyngeal • Vagus • Accessory • Hypoglossal")
footer(s)

cn_data = [
    ("VIII","Vestibulocochlear",COBALT,
     ["Cochlear: Hearing — finger rub test, Rinne & Weber with tuning fork",
      "Infants: localize a sound (rattle/bell from side)",
      "Vestibular: balance, nystagmus (fast phase AWAY from lesion)",
      "Nystagmus direction names the fast phase",
      "Audiometry for formal hearing assessment (ABR in infants)"]),
    ("IX","Glossopharyngeal",TEAL,
     ["Sensory: posterior 1/3 tongue, pharynx, tonsil, middle ear",
      "Taste: posterior 1/3 tongue",
      "Motor: stylopharyngeus (elevates pharynx in swallowing)",
      "Gag reflex: afferent CN IX → efferent CN X",
      "Rarely affected in isolation"]),
    ("X","Vagus",PURPLE,
     ["Motor: palate, pharynx, larynx",
      "Uvula deviates AWAY from the lesion",
      "Hoarse voice, dysphagia, nasal regurgitation",
      "Vasovagal syncope, cardiac rate control",
      "Bilateral: bulbar palsy (LMN), pseudobulbar (UMN)"]),
    ("XI","Accessory",RGBColor(0x17,0x6B,0x87),
     ["Motor: sternocleidomastoid (SCM) + upper trapezius",
      "SCM: turn head to opposite side",
      "Trapezius: shrug shoulders",
      "Test: head turning against resistance; shoulder shrug",
      "Wasting of SCM: torticollis or LMN XI palsy"]),
    ("XII","Hypoglossal",RGBColor(0x11,0x7A,0x65),
     ["Motor: all intrinsic + extrinsic tongue muscles",
      "LMN: tongue deviates TOWARDS the lesion",
      "UMN: tongue deviates AWAY from lesion",
      "Look for: fasciculations (LMN), wasting, deviation",
      "Test: protrude tongue, move side to side, push into cheek"]),
]

bw3=2.52; bx_start=0.22
for i,(cn,name,clr,pts) in enumerate(cn_data):
    bx=bx_start+i*2.62
    rect(s,bx,1.2,bw3,0.52,clr)
    txt(s,f"CN {cn}",bx+0.06,1.2,bw3-0.12,0.26,size=18,bold=True,
        color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.TOP)
    txt(s,name, bx+0.06,1.44,bw3-0.12,0.26,size=11,
        color=YELLOW,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.TOP)
    for j,pt in enumerate(pts):
        yy=1.74+j*1.0
        rect(s,bx,yy,bw3,0.96,SKY if j%2==0 else WHITE)
        txt(s,"• "+pt,bx+0.1,yy+0.06,bw3-0.18,0.86,size=11.5,color=DARK,
            anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 9 — MUSCLE BULK & TONE (intro)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Motor Examination — Muscle Bulk & Tone")
footer(s)

two_col_bullets(s,
    "MUSCLE BULK",
    ["Inspect for wasting/atrophy — LMN or disuse",
     "Pseudohypertrophy (calf, deltoid) → Duchenne/Becker MD",
     "True hypertrophy: myotonia congenita",
     "Hemisomatognosis: asymmetric limb growth → hemiplegic CP",
     "Compare both sides; measure circumference if asymmetric",
     "Tongue fasciculations — SMA (Werdnig-Hoffmann disease)"],
    "TYPES OF ABNORMAL TONE",
    ["SPASTICITY: velocity-dependent ↑ resistance (clasp-knife)",
     "   → UMN lesion (CP, stroke, cord compression)",
     "RIGIDITY: uniform ↑ resistance throughout ROM",
     "   Lead-pipe → Parkinson's; Cogwheel → tremor superimposed",
     "HYPOTONIA: ↓ resistance → floppy infant",
     "   Central: brain/cord; Peripheral: anterior horn, nerve, NMJ, muscle",
     "DYSTONIA: sustained muscle contractions → abnormal posture"],
    left_clr=COBALT, right_clr=TEAL, ystart=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 10 — TONE IN INFANTS (detailed)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Tone Examination in Infants — Detailed","Active Tone • Passive Tone • Postural Tone")
footer(s)

tone_sections = [
    ("ACTIVE TONE TESTS", NAVY, [
        ("Traction Response (Pull-to-sit)","Hold wrists, pull from supine to sitting. Normal: head lag decreases after 3 months. Significant head lag beyond 4 months = red flag"),
        ("Axillary Suspension","Hold under axillae. Normal: shoulder girdle firm. 'Slip-through' sign = hypotonia (hands slide up through examiner's hands)"),
        ("Vertical Suspension","Hold upright under axillae. Normal neonate: partial leg flexion. Hypotonia: legs hang limp. Spasticity: scissoring"),
    ]),
    ("PASSIVE TONE TESTS", COBALT, [
        ("Scarf Sign","Pull arm across chest. Elbow does NOT cross midline in term neonate. Elbow crosses midline = hypotonia"),
        ("Flap Hands/Feet","Shake extremities loosely. Exaggerated floppy movement = hypotonia. Stiff, limited = hypertonia"),
        ("Popliteal Angle","Flex hip to 90°, extend knee. <90° at birth (100–110° by 3 mo). Wide angle = hypotonia; narrow = hypertonia"),
    ]),
    ("POSTURAL/POSITIONAL TONE", TEAL, [
        ("Ventral (Prone) Suspension","Hold horizontally prone. Normal: head momentarily horizontal, partial limb flexion. Head/limbs hang = hypotonia"),
        ("Resting Posture","Frog-leg posture at rest = hypotonia. Opisthotonus = severe hypertonia (meningitis, kernicterus)"),
        ("Wrist Flexion Angle","Press hand toward forearm. Angle varies with age; reduces as tone increases with maturation"),
    ]),
]

bw4=4.1
for i,(title,clr,tests) in enumerate(tone_sections):
    bx=0.22+i*4.37
    rect(s,bx,1.2,bw4,0.44,clr)
    txt(s,title,bx+0.08,1.2,bw4-0.16,0.44,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    for j,(tname,tdesc) in enumerate(tests):
        yy=1.66+j*1.8
        rect(s,bx,yy,bw4,0.42,RGBColor(0xD5,0xE8,0xD4) if j%2==0 else SKY)
        txt(s,tname,bx+0.1,yy+0.03,bw4-0.18,0.36,size=13,bold=True,
            color=clr,anchor=MSO_ANCHOR.MIDDLE)
        rect(s,bx,yy+0.42,bw4,1.32,OFFWHITE if j%2==0 else WHITE)
        txt(s,tdesc,bx+0.12,yy+0.46,bw4-0.22,1.28,size=12,color=DARK,
            anchor=MSO_ANCHOR.TOP)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 11 — STRENGTH & MRC
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Motor Strength — Testing & MRC Grading")
footer(s)

section_hdr(s,"AGE-ADAPTED STRENGTH TESTING",0.25,1.22,12.8,clr=NAVY)

age_strength = [
    ("INFANTS","Observe spontaneous movements\nAsymmetric movement = red flag\nGrasp reflex strength\nKicking & pushing against resistance",COBALT),
    ("TODDLERS","Observe functional tasks:\n• Rising from floor (Gower's sign = proximal weakness)\n• Standing broad jump\n• Running, climbing stairs",TEAL),
    ("SCHOOL AGE","Confrontation testing — muscle groups\nPronator drift (UMN)\nHand grip dynamometry\nFunctional: pushups, heels, toes",PURPLE),
]
for i,(age,desc,clr) in enumerate(age_strength):
    bx=0.25+i*4.37
    bw5=4.1
    rect(s,bx,1.68,bw5,0.42,clr)
    txt(s,age,bx+0.08,1.68,bw5-0.16,0.42,size=14,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,2.12,bw5,2.2,SKY if i%2==0 else WHITE)
    for j,line in enumerate(desc.split("\n")):
        txt(s,"• "+line if not line.startswith("•") else line,
            bx+0.12,2.16+j*0.44,bw5-0.22,0.42,size=13,color=DARK)

# MRC Table
section_hdr(s,"MRC MUSCLE STRENGTH GRADING SCALE",0.25,4.45,12.8,clr=COBALT)
mrc = [
    ("0","No contraction","Flaccid paralysis — complete denervation",""),
    ("1","Flicker/trace","Visible/palpable contraction, no movement",""),
    ("2","Movement — gravity eliminated","Moves if gravity removed (horizontal)",""),
    ("3","Movement against gravity","Cannot overcome any added resistance","⚠ Significant weakness"),
    ("4","Movement against resistance","Subnormal strength","Clinical range: 4−, 4, 4+"),
    ("5","Normal power","Full strength against resistance","Normal"),
]
rect(s,0.25,4.9,12.8,0.4,NAVY)
for lbl,cx,cw in zip(["Grade","Description","Significance","Note"],
                       [0.35,1.4,4.5,9.8],[1.0,3.0,5.2,3.2]):
    txt(s,lbl,cx,4.92,cw,0.36,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(grade,desc,sig,note) in enumerate(mrc):
    yy=5.32+i*0.3
    bg=SKY if i%2==0 else WHITE
    clr_g=DARK if i<3 else (RED if i==3 else (ORANGE if i==4 else GREEN))
    rect(s,0.25,yy,12.8,0.3,bg)
    txt(s,grade,0.35,yy+0.02,0.9,0.26,size=12,bold=True,color=clr_g,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,desc,1.4,yy+0.02,3.0,0.26,size=12,bold=True,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sig,4.5,yy+0.02,5.2,0.26,size=11.5,color=GRAY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,note,9.8,yy+0.02,3.2,0.26,size=11.5,bold=bool(note),color=clr_g,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 12 — INVOLUNTARY MOVEMENTS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Involuntary Movements in Pediatric CNS")
footer(s)

inv_mvt = [
    ("FASCICULATIONS",RGBColor(0x0A,0x3D,0x62),
     "Fine flickering of muscle at rest","Visible without EMG","LMN / anterior horn cell (SMA, polio)","Tongue fasciculations → SMA (Werdnig-Hoffmann)"),
    ("TICS",COBALT,
     "Repetitive, stereotyped, suppressible","Brief jerks or sounds","Tourette syndrome (motor+vocal tics)","Transient tic disorder common in school age"),
    ("TREMOR",TEAL,
     "Rhythmic oscillation","Rest: Parkinson's (rare in children)","Action/intention: Cerebellar","Postural: Essential tremor, thyrotoxicosis"),
    ("CHOREA",PURPLE,
     "Brief, random, irregular dance-like","Non-rhythmic, flows between body parts","Sydenham's chorea (RF), Huntington's","Hemiballismus: violent flinging (subthalamic)"),
    ("ATHETOSIS",RGBColor(0x17,0x6B,0x87),
     "Slow, writhing, sinuous movements","Distal limbs mainly","Often combined: choreoathetosis","Kernicterus, CP (dyskinetic type)"),
    ("DYSTONIA",RGBColor(0x6C,0x35,0x82),
     "Sustained abnormal posture","Twisting, repetitive movements","Primary or secondary (Wilson's, DYT1 gene)","Writer's cramp: focal dystonia"),
    ("MYOCLONUS",RGBColor(0x11,0x7A,0x65),
     "Sudden brief shock-like jerks","Positive (muscle contraction) or negative","Juvenile myoclonic epilepsy (JME)","Benign neonatal myoclonus during sleep"),
]

bw6,bh6 = 1.82,5.45
for i,(name,clr,d1,d2,d3,d4) in enumerate(inv_mvt):
    bx=0.22+i*1.88
    rect(s,bx,1.2,bw6,0.48,clr)
    txt(s,name,bx+0.05,1.2,bw6-0.1,0.48,size=12,bold=True,
        color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    for j,desc in enumerate([d1,d2,d3,d4]):
        yy=1.7+j*1.3
        rect(s,bx,yy,bw6,1.25,SKY if j%2==0 else WHITE)
        txt(s,desc,bx+0.07,yy+0.06,bw6-0.12,1.16,size=11.5,color=DARK,
            anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 13 — DEEP TENDON REFLEXES
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Deep Tendon Reflexes (DTRs)","Spinal reflex arc • Grading • Clinical significance")
footer(s)

section_hdr(s,"REFLEX ARC",0.25,1.22,4.0,clr=NAVY)
arc_pts=["Stimulus → sensory receptor (muscle spindle Ia afferent)",
         "Afferent neuron → dorsal horn of spinal cord",
         "Synapse directly on alpha motor neuron (monosynaptic arc)",
         "Efferent via ventral horn → motor end plate → muscle contraction",
         "UMN inhibits reflex arc → UMN lesion = ↑ reflexes (disinhibition)",
         "LMN lesion = ↓ or absent reflexes"]
bullet_box(s,arc_pts,0.25,1.66,4.0,2.98,size=12.5,bg=SKY)

section_hdr(s,"GRADING SCALE",0.25,4.7,4.0,clr=COBALT)
grade_data=[("0","Absent","Areflexia — LMN/neuropathy/myopathy"),
            ("1+","Diminished","Hyporeflexia — LMN or peripheral"),
            ("2+","Normal","Normal"),
            ("3+","Brisk","UMN lesion / hyperthyroidism"),
            ("4+","Clonus","UMN lesion — always pathological")]
for i,(g,label,mean) in enumerate(grade_data):
    yy=5.14+i*0.38
    bg=LRED if i>=3 else (SKY if i%2==0 else WHITE)
    rect(s,0.25,yy,4.0,0.36,bg)
    rect(s,0.25,yy,0.5,0.36,COBALT if i<3 else RED)
    txt(s,g,0.25,yy+0.02,0.5,0.32,size=13,bold=True,color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,label,0.8,yy+0.02,1.3,0.32,size=12,bold=True,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,mean,2.15,yy+0.02,2.0,0.32,size=11.5,color=GRAY,anchor=MSO_ANCHOR.MIDDLE)

section_hdr(s,"REFLEXES & LEVELS",4.5,1.22,8.55,clr=TEAL)
reflex_rows=[
    ("Biceps jerk","C5, C6","Flex elbow slightly, tap biceps tendon","↑ C5/6 UMN; ↓ C5/6 LMN"),
    ("Triceps jerk","C7","Arm flexed at elbow, tap triceps tendon","↑ C7 UMN; ↓ C7 LMN"),
    ("Brachioradialis","C5, C6","Tap styloid process/brachioradialis tendon","↑ UMN; supinator catch"),
    ("Knee jerk","L3, L4","Tap patellar tendon","↑ UMN; ↓ femoral neuropathy, L3/4 disc"),
    ("Ankle jerk","S1, S2","Tap Achilles tendon","↑ UMN; ↓ S1 radiculopathy, peripheral neuropathy"),
    ("Jaw jerk","Pons","Tap chin with mouth slightly open","↑↑ pseudobulbar palsy (bilateral UMN)"),
]
rect(s,4.5,1.66,8.55,0.4,NAVY)
for lbl,cx,cw in zip(["Reflex","Level","Technique","Significance"],[4.6,6.0,7.1,9.95],[1.35,1.05,2.8,3.0]):
    txt(s,lbl,cx,1.68,cw,0.36,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(ref,lvl,tech,sig) in enumerate(reflex_rows):
    yy=2.08+i*0.82
    bg=SKY if i%2==0 else WHITE
    rect(s,4.5,yy,8.55,0.8,bg)
    txt(s,ref,4.6,yy+0.04,1.35,0.72,size=12,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,lvl,6.05,yy+0.04,1.0,0.72,size=12,color=COBALT,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,tech,7.15,yy+0.04,2.75,0.72,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sig,9.98,yy+0.04,2.98,0.72,size=11.5,color=GRAY,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 14 — PRIMITIVE REFLEXES (detailed)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Primitive Reflexes — Detailed Guide","Normal emergence, disappearance & clinical significance")
footer(s)

prim_detailed = [
    ("Moro Reflex","Birth","4–6 months",
     "Hold semi-upright, let head fall 30°. Normal: arms abduct+extend then adduct (embrace). Cry follows.",
     "Absent: severe encephalopathy, C5-6 injury. Asymmetric: brachial palsy, hemiplegia. Persistence: CP, brain damage"),
    ("Rooting Reflex","Birth","3–4 months",
     "Stroke corner of mouth / cheek. Normal: head turns to stimulus, mouth opens.",
     "Absence in neonate: severe encephalopathy. Persistence beyond 1 year: frontal lobe damage"),
    ("Palmar Grasp","Birth","3–6 months",
     "Press finger on palm. Normal: fingers flex and grasp. Cannot be opened voluntarily.",
     "Asymmetric: contralateral hemisphere lesion. Persistence: UMN lesion"),
    ("Plantar Grasp","Birth","9–12 months",
     "Press thumb on ball of foot. Normal: toe flexion and gripping.",
     "Persistence beyond 1 year suggests UMN involvement"),
    ("ATNR (Fencer)","Birth","4–6 months",
     "Turn head to one side. Normal: extension of limbs on face side, flexion on skull side.",
     "Obligatory ATNR (cannot break) = severe CNS damage. Persistence: hemiplegic CP"),
    ("Stepping Reflex","Birth","2–3 months",
     "Hold upright, sole contacts surface. Normal: alternating stepping movements.",
     "Absence with flaccidity: lower limb injury. Persistence: not pathological alone"),
    ("Parachute Reflex","8–9 months","Persists lifelong",
     "Hold prone, tilt suddenly towards floor. Normal: arms extend, hands open (protective).",
     "Absence or asymmetry after 12 months: serious UMN concern. Asymmetric: hemiplegia"),
    ("Galant Reflex","Birth","4–6 months",
     "Hold prone, stroke paravertebral skin. Normal: trunk curves toward stimulus (lateral flexion).",
     "Persistence: may interfere with sitting. Absence can suggest spinal cord lesion"),
]
# Table
rect(s,0.25,1.22,12.8,0.42,NAVY)
for lbl,cx,cw in zip(["Reflex","Appears","Disappears","How to elicit","Significance"],
                       [0.35,2.15,3.0,4.0,8.2],[1.75,0.8,0.95,4.1,4.85]):
    txt(s,lbl,cx,1.24,cw,0.38,size=11.5,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(name,app,dis,how,sig) in enumerate(prim_detailed):
    yy=1.66+i*0.67
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.65,bg)
    dis_clr=GREEN if "Persists" in dis else DARK
    txt(s,name,0.35,yy+0.04,1.7,0.58,size=11.5,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,app,2.15,yy+0.04,0.75,0.58,size=11,color=GRAY,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,dis,3.0,yy+0.04,0.9,0.58,size=11,bold=True,color=dis_clr,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,how,4.0,yy+0.04,4.05,0.58,size=11,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sig,8.2,yy+0.04,4.7,0.58,size=11,color=RED,anchor=MSO_ANCHOR.MIDDLE)

rect(s,0.25,7.0,12.8,0.1,RED)
txt(s,"⚠  Persistence of ANY primitive reflex beyond expected age = significant red flag for UMN pathology / cerebral palsy",
    0.35,7.05,12.5,0.28,size=12,bold=True,color=RED,align=PP_ALIGN.CENTER)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 15 — SUPERFICIAL & PATHOLOGICAL REFLEXES
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Superficial & Pathological Reflexes")
footer(s)

two_col_bullets(s,
    "SUPERFICIAL REFLEXES",
    ["Corneal reflex: cotton wisp → CN V afferent, CN VII efferent",
     "Gag reflex: CN IX afferent, CN X efferent — present in term neonates",
     "Abdominal reflex (T7–T12): stroke abdomen quadrant → umbilicus moves to that side",
     "  Absent abdominal reflexes = UMN lesion (cord compression above T7)",
     "Cremasteric reflex (L1–L2): stroke medial thigh → testis ascends",
     "Anal reflex (S3–S4): prick perianal skin → anal wink (sphincter contracts)",
     "Plantar response: stroke lateral sole (Babinski manoeuvre)",
     "  Normal <12–18 months: upgoing (extensor response) — physiological"],
    "PATHOLOGICAL REFLEXES",
    ["Babinski sign: extensor plantar response after 18 months = UMN lesion",
     "Chaddock: stroke lateral aspect of foot → extensor plantar (equivalent)",
     "Oppenheim: thumb along shin → extensor plantar (equivalent)",
     "Gordon: squeeze calf → extensor plantar (equivalent)",
     "Hoffmann sign: flick middle finger → thumb flexion/adduction = UMN (cervical)",
     "Clonus: >3 beats = UMN; sustained = significant UMN pathology",
     "Jaw clonus: sustained jaw clench → pseudobulbar palsy",
     "Glabellar tap: repeated taps on glabella → should extinguish (don't extinguish in parkinsonism)"],
    left_clr=COBALT, right_clr=RED, ystart=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 16 — COORDINATION (Cerebellar)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Coordination & Cerebellar Function","The DANISH mnemonic")
footer(s)

section_hdr(s,"DANISH MNEMONIC FOR CEREBELLAR SIGNS",0.25,1.22,12.8,clr=NAVY)
danish=[
    ("D","Dysdiadochokinesia","Rapid alternating hand movements (pronate/supinate). Clumsy, irregular.","Ipsilateral cerebellar hemisphere"),
    ("A","Ataxia","Unsteady, wide-based gait; falls toward lesion side","Cerebellar vermis or hemisphere"),
    ("N","Nystagmus","Horizontal nystagmus; fast phase toward lesion side","Flocculus / vestibular connections"),
    ("I","Intention Tremor","Finger-nose-finger test: tremor worsens nearing target","Cerebellar hemisphere"),
    ("S","Slurred speech","Scanning/staccato dysarthria — jerky, explosive speech","Cerebellum / connections"),
    ("H","Hypotonia","Pendular knee jerk; decreased resistance to passive movement","Cerebellar hemisphere"),
]
rect(s,0.25,1.68,12.8,0.4,COBALT)
for lbl,cx,cw in zip(["Letter","Sign","Test / Description","Localisation"],
                       [0.35,1.1,2.7,8.5],[0.7,1.55,5.7,4.2]):
    txt(s,lbl,cx,1.7,cw,0.36,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(let,sign,desc,loc) in enumerate(danish):
    yy=2.1+i*0.76
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.74,bg)
    rect(s,0.25,yy,0.7,0.74,TEAL if i%2==0 else COBALT)
    txt(s,let,0.25,yy,0.7,0.74,size=26,bold=True,color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sign,1.1,yy+0.06,1.5,0.62,size=13,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,desc,2.7,yy+0.06,5.65,0.62,size=12,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,loc,8.5,yy+0.06,4.45,0.62,size=12,bold=True,color=TEAL,anchor=MSO_ANCHOR.MIDDLE)

section_hdr(s,"ADDITIONAL CEREBELLAR TESTS",0.25,6.68,12.8,clr=TEAL)
extra="Romberg test (positive in proprioceptive, NOT cerebellar ataxia)  |  Heel-knee-shin (lower limb)  |  Rebound phenomenon  |  Tandem (heel-toe) walking"
txt(s,extra,0.35,7.13,12.5,0.38,size=13,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 17 — GAIT (detailed 7 types)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Gait Analysis — 7 Types in Pediatrics")
footer(s)

gait7 = [
    (NAVY,    "Hemiplegic",    "Arm flexed + adducted; leg circumducts (swings out in arc)",    "Spastic hemiplegia (unilateral CP, stroke)",         "Asymmetric arm swing; shoe sole worn on outer edge"),
    (COBALT,  "Scissor",       "Hips adducted, knees rub together, tiptoe walking",             "Spastic diplegia (bilateral CP, PVL)",                "Legs cross midline; narrow base; hip spasm"),
    (TEAL,    "Waddling",      "Exaggerated side-to-side trunk sway; wide base",                "Proximal myopathy — Duchenne MD, hip dislocation",   "Trendelenburg sign: contralateral hip drops on stance"),
    (GREEN,   "Steppage",      "High stepping; foot slap at heel strike",                       "Foot drop — peroneal nerve palsy, CMT neuropathy",   "Cannot walk on heels; lateral leg wasting"),
    (PURPLE,  "Ataxic",        "Wide-based, lurching, unable to walk in straight line",         "Cerebellar disease, sensory ataxia, intoxication",   "Romberg test helps distinguish cerebellar vs sensory"),
    (ORANGE,  "Toe Walking",   "Bilateral equinus posture; persistent toe-toe gait",            "Spastic CP, idiopathic, autism, sensory processing", "If asymmetric → neurological; symmetric often habitual"),
    (RED,     "Antalgic",      "Reduced stance time on painful limb; limp",                    "Joint disease (septic arthritis, JIA, Perthes, SUFE)","Trendelenburg/Perthes gait in hip pathology"),
]
rect(s,0.25,1.22,12.8,0.42,NAVY)
for lbl,cx,cw in zip(["Gait Type","Description","Cause","Key Observation"],
                       [0.35,2.5,6.3,9.6],[2.1,3.75,3.25,3.5]):
    txt(s,lbl,cx,1.24,cw,0.38,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(clr,name,desc,cause,obs) in enumerate(gait7):
    yy=1.66+i*0.76
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.74,bg)
    rect(s,0.25,yy,2.2,0.74,clr)
    txt(s,name,0.32,yy+0.04,2.05,0.66,size=13,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,desc,2.55,yy+0.04,3.65,0.66,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,cause,6.35,yy+0.04,3.2,0.66,size=11.5,bold=True,color=clr,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,obs,9.65,yy+0.04,3.45,0.66,size=11,color=GRAY,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 18 — SENSORY EXAMINATION
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Sensory Examination in Pediatrics")
footer(s)

two_col_bullets(s,
    "PRIMARY SENSORY MODALITIES",
    ["LIGHT TOUCH: Cotton wisp / fingertip; stroke from distal to proximal",
     "   Dorsal columns (ipsilateral) → thalamus → sensory cortex",
     "PAIN: Pin-prick (disposable neurological pin)",
     "   Spinothalamic tract (crosses at same level, contralateral)",
     "TEMPERATURE: Warm/cold test tubes",
     "   Same pathway as pain (lateral spinothalamic tract)",
     "VIBRATION: 128 Hz tuning fork on bony prominence",
     "   Dorsal column–medial lemniscal pathway (ipsilateral)",
     "PROPRIOCEPTION: Move finger/toe up or down with eyes closed",
     "   Dorsal columns — absent = sensory ataxia, peripheral neuropathy"],
    "HIGHER / CORTICAL SENSORY TESTS",
    ["GRAPHESTHESIA: Write number in palm with fingertip",
     "   Test parietal lobe integration (contra parietal cortex)",
     "STEREOGNOSIS: Identify object by feel (coin, key)",
     "   Tests parietal association cortex",
     "TWO-POINT DISCRIMINATION: Two pins simultaneously — minimum separation",
     "   Finger pulp normal: 2–4 mm; abnormal if > 6 mm",
     "SENSORY EXTINCTION: Touch both sides simultaneously",
     "   Neglect one side = parietal contralateral lesion",
     "POINT LOCALISATION: Touch → patient points to spot with eyes closed",
     "   Tests fine discriminative touch (somatosensory cortex)"],
    left_clr=COBALT, right_clr=TEAL, ystart=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 19 — HEAD CIRCUMFERENCE & FONTANELLE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Head Circumference & Fontanelle Examination")
footer(s)

section_hdr(s,"HEAD CIRCUMFERENCE — NORMAL VALUES & INTERPRETATION",0.25,1.22,12.8,clr=NAVY)
hc_table=[
    ("At birth","~33–35 cm","~33–34 cm","Plot on WHO growth chart"),
    ("3 months","~40 cm","~39 cm","Grows ~2 cm/month in first 3 months"),
    ("6 months","~43 cm","~42 cm","Grows ~1 cm/month months 4–6"),
    ("9 months","~45 cm","~44 cm","Grows ~0.5 cm/month months 7–12"),
    ("1 year","~47 cm","~46 cm","Half postnatal head growth by 6 months"),
    ("2 years","~49 cm","~48 cm","Measure at every visit <2 years"),
]
rect(s,0.25,1.68,12.8,0.38,COBALT)
for lbl,cx,cw in zip(["Age","Male OFC","Female OFC","Note"],
                       [0.35,2.5,4.5,6.5],[2.1,1.95,1.95,6.4]):
    txt(s,lbl,cx,1.7,cw,0.34,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(age,m,f,note) in enumerate(hc_table):
    yy=2.08+i*0.4
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.38,bg)
    for val,cx,cw in [(age,0.35,2.1),(m,2.5,1.9),(f,4.5,1.9),(note,6.5,6.4)]:
        txt(s,val,cx,yy+0.04,cw,0.3,size=12,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

rect(s,0.25,4.55,5.9,0.42,RED)
txt(s,"MACROCEPHALY (>97th / >2SD)",0.35,4.55,5.7,0.42,size=13,bold=True,
    color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
macro_pts=["Hydrocephalus (obstructive / communicating)",
           "Megalencephaly (metabolic storage, NF1)",
           "Subdural collections (NAI, meningitis)",
           "Familial macrocephaly (check parents' OFC)"]
bullet_box(s,macro_pts,0.25,4.99,5.9,1.98,size=12.5,bg=LRED)

rect(s,6.85,4.55,6.2,0.42,COBALT)
txt(s,"MICROCEPHALY (<3rd / <2SD)",6.95,4.55,6.0,0.42,size=13,bold=True,
    color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
micro_pts=["TORCH infections (congenital)",
           "Genetic: Microcephalin, ASPM mutations",
           "Chromosomal: trisomies, Rett syndrome",
           "Hypoxic-ischaemic encephalopathy (HIE)",
           "Zika virus (congenital)"]
bullet_box(s,micro_pts,6.85,4.99,6.2,1.98,size=12.5,bg=SKY)

# FONTANELLE
section_hdr(s,"FONTANELLE EXAMINATION",0.25,4.55,6.2,clr=RED) # now overridden above; do after
# Redo layout below HC table
rect(s,0.25,7.0,12.8,0.06,TEAL)
font_txt=("Anterior fontanelle: diamond, closes 9–18 months  "
          "| Posterior fontanelle: triangle, closes 6–8 weeks  "
          "| Bulging = ↑ICP (meningitis, hydrocephalus)  "
          "| Sunken = dehydration  "
          "| Late closure > 18 mo: hypothyroidism, rickets, trisomy 21")
txt(s,font_txt,0.3,7.07,12.7,0.38,size=11.5,bold=True,color=NAVY,align=PP_ALIGN.LEFT)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 20 — DEVELOPMENTAL MILESTONES — MOTOR
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Developmental Milestones — Motor","Gross Motor & Fine Motor")
footer(s)

section_hdr(s,"GROSS MOTOR MILESTONES",0.25,1.22,12.8,clr=NAVY)
gm=[
    ("1 month","Turns head side to side in prone","Raises head 45° in prone"),
    ("2 months","Holds head up briefly","Chest up with forearm support"),
    ("3–4 months","Head control — no head lag on pull-to-sit","Rolls prone to supine"),
    ("5–6 months","Sits with support","Rolls both ways; bears weight on legs"),
    ("7–8 months","Sits without support (tripod → independent)","Pivots in prone"),
    ("9–10 months","Crawls on all fours; pulls to stand","Cruises along furniture"),
    ("12 months","Walks independently (±2 months)","Stands alone momentarily"),
    ("15–18 months","Walks well; stoops and recovers","Runs (stiffly); walks upstairs with hand"),
    ("2 years","Runs well; kicks ball; walks upstairs 2 feet/step","Jumps"),
    ("3 years","Rides tricycle; alternates feet on stairs","Stands on one foot 3 seconds"),
    ("4–5 years","Hops; skips; balances on one foot 5–10 sec","Tandem gait by 5–6 years"),
]
rect(s,0.25,1.68,12.8,0.38,COBALT)
for lbl,cx,cw in zip(["Age","Gross Motor","Additional"],[0.35,2.0,7.3],[1.6,5.2,5.6]):
    txt(s,lbl,cx,1.7,cw,0.34,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(age,gm1,gm2) in enumerate(gm):
    yy=2.08+i*0.44
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.42,bg)
    rect(s,0.25,yy,1.7,0.42,COBALT if i%2==0 else NAVY)
    txt(s,age,0.32,yy+0.04,1.58,0.34,size=11.5,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,gm1,2.02,yy+0.04,5.15,0.34,size=12,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,gm2,7.35,yy+0.04,5.5,0.34,size=12,color=GRAY,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 21 — DEVELOPMENTAL MILESTONES — LANGUAGE & SOCIAL
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Developmental Milestones — Language & Social / Adaptive")
footer(s)

two_col_bullets(s,
    "LANGUAGE MILESTONES",
    ["Birth–2 months: Startles to sound; coos (vowel sounds)",
     "3–4 months: Laughs; turns to voice",
     "6 months: Babbles (ba-ba, da-da — non-specific)",
     "9 months: Jargon; 'mama/dada' — non-specific",
     "12 months: 1 meaningful word; 'mama/dada' specific",
     "15 months: 3–5 words; points to 1 body part",
     "18 months: 10+ words; 2-word vocab + gesture",
     "2 years: 50+ words; 2-word phrases (noun + verb)",
     "3 years: 3-word sentences; 75% intelligible to strangers",
     "4–5 years: Full sentences; 100% intelligible; tells stories"],
    "SOCIAL / ADAPTIVE MILESTONES",
    ["4–6 weeks: Social smile (responsive)",
     "3 months: Recognises mother",
     "6 months: Smiles at self in mirror; stranger anxiety begins",
     "9 months: Waves bye-bye; plays peek-a-boo",
     "12 months: Comes when called; plays interactive games",
     "15 months: Points to desired objects",
     "18 months: Symbolic/pretend play begins",
     "2 years: Parallel play; uses spoon; removes clothes",
     "3 years: Group play; dresses with help; toilet trained day",
     "5 years: Cooperative play; tells stories; ties shoelaces"],
    left_clr=COBALT, right_clr=TEAL, ystart=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 22 — RED FLAGS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Red Flags in Pediatric CNS","Referral criteria & urgency indicators")
footer(s)

urgent_flags=[
    ("URGENT / EMERGENCY",RED,[
        "Sudden onset encephalopathy or impaired consciousness",
        "Seizure with focal deficit, status epilepticus",
        "Meningism: neck stiffness, photophobia, Kernig's, Brudzinski's",
        "Bulging fontanelle + fever = meningitis until proven otherwise",
        "Acute ataxia with vomiting + headache → posterior fossa mass",
        "Cranial nerve palsy + papilledema → ↑ICP → urgent imaging",
    ]),
    ("SOON (within 1–2 weeks)",ORANGE,[
        "Developmental regression — loss of milestones",
        "Persistent Babinski after 18 months",
        "Persistence of primitive reflexes beyond expected age",
        "Asymmetric tone, reflexes, or motor function",
        "Rapidly increasing OFC crossing centiles",
        "New onset squint / nystagmus",
    ]),
    ("ROUTINE REFERRAL",COBALT,[
        "Global developmental delay — all domains",
        "Language delay — no words by 18 months, no phrases by 2 years",
        "Early hand dominance before 12 months",
        "Fine motor delay — unable to pincer grasp by 12 months",
        "Gait abnormality — persistent toe walking, waddling, scissoring",
        "Hypotonia — floppy infant without clear cause",
    ]),
]
bw7,ystart7 = 4.1, 1.22
for i,(title,clr,flags) in enumerate(urgent_flags):
    bx=0.22+i*4.37
    rect(s,bx,ystart7,bw7,0.46,clr)
    txt(s,title,bx+0.08,ystart7+0.02,bw7-0.14,0.42,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    for j,flag in enumerate(flags):
        yy=ystart7+0.48+j*0.94
        rect(s,bx,yy,bw7,0.9,LRED if clr==RED else (LORANGE if clr==ORANGE else SKY))
        rect(s,bx,yy,0.3,0.9,clr)
        txt(s,flag,bx+0.35,yy+0.06,bw7-0.42,0.8,size=12.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 23 — AGE-WISE APPROACH
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"Age-Wise CNS Examination — Clinical Approach")
footer(s)

age_approach=[
    (NAVY,"NEONATE\n(0–4 wks)",[
        "Undress fully; warm room",
        "Posture: flexed at rest (term); extended (preterm)",
        "Tone: traction, ventral suspension, scarf sign",
        "Primitive reflexes: Moro, rooting, grasp, ATNR",
        "Cry quality and feeding vigour",
        "Fontanelle, OFC measurement",
        "Pupillary response, red reflex",
        "Sucking + gag reflex"]),
    (COBALT,"INFANT\n(1–12 mo)",[
        "Observe before handling (movement, tone at rest)",
        "Fix and follow — by 6–8 weeks",
        "Social smile — by 6 weeks",
        "Track disappearance of primitive reflexes",
        "Parachute reflex — emerges 8–9 months",
        "Head control (no lag by 4 months)",
        "Tone tests: traction, axillary stability, scarf",
        "Babbling and sound localisation"]),
    (TEAL,"TODDLER\n(1–3 yrs)",[
        "Bring toys — engage in play",
        "Observe gait on walking to parent",
        "Heel-toe walking attempts",
        "Language milestones",
        "Hand dominance — early? (red flag)",
        "Confrontation visual fields (toy distraction)",
        "Functional strength: squat/rise, climbing",
        "Formal coordination — block stacking"]),
    (PURPLE,"SCHOOL AGE\n(5–12 yrs)",[
        "Full formal CNS exam possible",
        "Mental status: orientation, cognition, language",
        "12 cranial nerves systematically",
        "Motor: confrontation, pronator drift",
        "Coordination: DANISH tests",
        "Gait: heel-toe, tandem, tiptoe, heels",
        "Sensory: all modalities",
        "Reflexes: DTRs + plantar response"]),
    (GREEN,"ADOLESCENT\n(>12 yrs)",[
        "Adult-style complete examination",
        "HEADSS screen (psychosocial)",
        "Higher cognitive function testing",
        "Screen for depression/anxiety",
        "Functional neurological symptoms",
        "Detailed headache evaluation",
        "Signs of raised ICP: papilledema",
        "Substance use effect on neuro exam"]),
]
bw8=2.48
for i,(clr,title,pts) in enumerate(age_approach):
    bx=0.22+i*2.62
    rect(s,bx,1.22,bw8,0.8,clr)
    txt(s,title,bx+0.06,1.22,bw8-0.1,0.8,size=13,bold=True,
        color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    for j,pt in enumerate(pts):
        yy=2.04+j*0.62
        rect(s,bx,yy,bw8,0.6,SKY if j%2==0 else WHITE)
        txt(s,"• "+pt,bx+0.1,yy+0.04,bw8-0.16,0.54,size=11.5,color=DARK,
            anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 24 — FLOPPY INFANT (Hypotonia)
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
header(s,"The Floppy Infant — Approach to Hypotonia","Central vs Peripheral Hypotonia")
footer(s)

section_hdr(s,"CENTRAL HYPOTONIA",0.25,1.22,6.2,clr=NAVY)
central_pts=[
    "Brain or spinal cord origin",
    "Alert, responsive — good eye contact",
    "Suck/swallow MAY be preserved initially",
    "Reflexes: NORMAL or BRISK (UMN signs emerge later)",
    "Often associated: dysmorphic features, seizures",
    "MRI brain — may show structural abnormality",
    "Causes: HIE, chromosomal (Down, Prader-Willi), metabolic, brain malformation",
]
bullet_box(s,central_pts,0.25,1.68,6.2,3.0,size=13,bg=SKY)

section_hdr(s,"PERIPHERAL HYPOTONIA",6.85,1.22,6.2,clr=TEAL)
periph_pts=[
    "Anterior horn cell / nerve / NMJ / muscle",
    "Weak — cannot lift limbs against gravity",
    "Areflexia or markedly depressed reflexes",
    "Fasciculations (tongue) → anterior horn cell",
    "CK markedly elevated → primary myopathy",
    "EMG + NCS: distinguish neuropathy vs myopathy",
    "Causes: SMA, myotonic dystrophy, neonatal MG, infantile botulism",
]
bullet_box(s,periph_pts,6.85,1.68,6.2,3.0,size=13,bg=MINT)

section_hdr(s,"DIFFERENTIATING FEATURES",0.25,4.78,12.8,clr=COBALT)
diff=[
    ("Feature","Central Hypotonia","Peripheral Hypotonia"),
    ("Alertness","Alert, responsive","Alert; poor strength"),
    ("DTRs","Normal / brisk","Absent / diminished"),
    ("Fasciculations","Absent","Present (ant. horn)"),
    ("Weakness","Mild relative to tone","Severe, profound"),
    ("CK level","Normal/mildly ↑","Normal/very ↑ (myopathy)"),
    ("MRI brain","Abnormal","Usually normal"),
]
rect(s,0.25,5.24,12.8,0.38,NAVY)
for lbl,cx,cw in zip(["Feature","Central","Peripheral"],[0.35,4.5,9.0],[4.1,4.4,4.2]):
    txt(s,lbl,cx,5.26,cw,0.34,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(feat,cent,peri) in enumerate(diff[1:]):
    yy=5.64+i*0.3
    bg=SKY if i%2==0 else WHITE
    rect(s,0.25,yy,12.8,0.3,bg)
    txt(s,feat,0.35,yy+0.02,4.1,0.26,size=12,bold=True,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,cent,4.55,yy+0.02,4.35,0.26,size=12,color=COBALT,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,peri,9.05,yy+0.02,4.15,0.26,size=12,color=TEAL,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 25 — SUMMARY & REFERENCE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,NAVY)
rect(s,0,5.65,13.333,1.85,COBALT)
rect(s,0,7.15,13.333,0.35,TEAL)

txt(s,"Key Clinical Pearls",0.5,0.25,12.3,0.9,size=36,bold=True,
    color=YELLOW,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)

pearls=[
    "Observation FIRST — most information comes from watching the child before formal testing",
    "Adapt every test to developmental age — no single approach fits neonate to adolescent",
    "Head circumference must be plotted at every visit in the first 2 years of life",
    "Primitive reflexes have a fixed timeline — persistence beyond expected age = significant red flag",
    "Babinski sign is NORMAL in infants <18 months; pathological after that age",
    "Early hand dominance before 12 months → suspect contralateral hemisphere lesion",
    "Floppy infant: distinguish central (alert, brisk reflexes) from peripheral (weak, areflexia, fasciculations)",
    "Pronator drift and Gower's sign are simple, high-yield bedside motor tests in older children",
    "DANISH mnemonic: Dysdiadochokinesia, Ataxia, Nystagmus, Intention tremor, Slurred speech, Hypotonia",
    "Regression of any milestone is ALWAYS pathological — urgent evaluation required",
]
for i,pearl in enumerate(pearls):
    y=1.22+i*0.59
    rect(s,0.45,y,0.5,0.52,TEAL)
    txt(s,str(i+1),0.45,y,0.5,0.52,size=16,bold=True,
        color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,pearl,1.05,y+0.04,11.7,0.46,size=14,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)

txt(s,"Reference: Santhosh Kumar — Pediatric Clinical Methods",
    0.5,5.75,12.3,0.52,size=19,bold=True,
    color=YELLOW,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
txt(s,"Harriet Lane Handbook 23e  |  Bradley & Daroff's Neurology in Clinical Practice",
    0.5,6.32,12.3,0.42,size=14,color=WHITE,align=PP_ALIGN.CENTER)

# ─── SAVE ──────────────────────────────────────────────────────────────────
out="/tmp/workspace/cns-peds-ppt/CNS_Examination_Pediatrics_DETAILED.pptx"
buf=BytesIO()
prs.save(buf)
with open(out,"wb") as f: f.write(buf.getvalue())
print(f"Saved: {out}  |  Slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/cns-peds-ppt && python create_detailed_ppt.py 2>&1

Running Command

python -c " from pptx import Presentation prs = Presentation('/tmp/workspace/cns-peds-ppt/CNS_Examination_Pediatrics_DETAILED.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): titles = [s.text_frame.text.strip()[:70] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] print(f' Slide {i:02d}: {titles[0] if titles else \"(blank)\"}') "

Your detailed PPT is ready — 25 slides, fully expanded:

CNS Examination Pediatrics DETAILED

Presentation · PPTX


25 Slides — Full Content:
#SlideWhat's Inside
1TitleCNS Examination in Pediatrics
2Contents23-topic index with colour coding
3Mental Status5 domains (Alertness, Orientation, Language, Cognition, Behaviour) — age-adapted
4CN I — OlfactoryAnatomy, pathway, how to test at each age, anosmia causes
5CN II — OpticVisual acuity, fields, pupillary reflexes, fundoscopy (red reflex, papilledema, cherry-red spot)
6CN III, IV, VINerve functions table, H-pattern testing, CN palsies (surgical vs medical CN III)
7CN V & VIITrigeminal divisions + corneal reflex; Facial palsy UMN vs LMN, Bell's palsy, taste
8CN VIII–XIIAll 5 nerves — cochlear/vestibular, gag, uvula deviation, tongue deviation rules
9Motor — Bulk & ToneSpasticity vs Rigidity vs Hypotonia — definitions + causes
10Tone in InfantsTraction response, axillary suspension, scarf sign, popliteal angle, ventral suspension
11Strength & MRCAge-adapted testing (Gower's, pronator drift); full MRC 0–5 grading table
12Involuntary Movements7 types: Fasciculations, Tics, Tremor, Chorea, Athetosis, Dystonia, Myoclonus
13Deep Tendon ReflexesReflex arc, grading 0–4+, 6 reflexes with levels and technique
14Primitive Reflexes8 reflexes — how to elicit, disappearance age, clinical significance
15Superficial & PathologicalCorneal, gag, abdominal, Babinski, Hoffmann, Clonus, Chaddock, Oppenheim
16CoordinationDANISH mnemonic in full — all 6 signs with localisation
17Gait Analysis7 gait types — description, cause, key observation
18SensoryPrimary (5 modalities) + Cortical (graphesthesia, stereognosis, 2-point, extinction)
19Head CircumferenceOFC table by age, macrocephaly vs microcephaly causes; fontanelle guide
20Motor MilestonesFull gross motor table birth to 5 years
21Language & SocialFull language + social/adaptive milestones birth to 5 years
22Red Flags3-tier urgency: Emergency / Soon / Routine — 18 red flags
23Age-Wise Approach5 age bands (Neonate → Adolescent) with specific exam focus
24Floppy InfantCentral vs Peripheral hypotonia — differentiating table
25Key Pearls10 clinical pearls + Reference: Santhosh Kumar

New born examination head to toe And reflexes , krammerw ,normal new born finding ,

Reading File
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Writing File

~/cns-peds-ppt/newborn_exam_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from io import BytesIO

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)

# ── PALETTE ──────────────────────────────────────────────────────────────────
NAVY    = RGBColor(0x0A, 0x3D, 0x62)
COBALT  = RGBColor(0x13, 0x6C, 0xB0)
SKY     = RGBColor(0xD6, 0xEA, 0xF8)
TEAL    = RGBColor(0x00, 0x87, 0x87)
MINT    = RGBColor(0xD5, 0xF5, 0xE3)
WHITE   = RGBColor(0xFF, 0xFF, 0xFF)
OFFWHITE= RGBColor(0xF4, 0xF8, 0xFD)
DARK    = RGBColor(0x1C, 0x1C, 0x1C)
GRAY    = RGBColor(0x50, 0x50, 0x50)
RED     = RGBColor(0xC0, 0x39, 0x2B)
LRED    = RGBColor(0xFF, 0xEB, 0xEB)
ORANGE  = RGBColor(0xD3, 0x54, 0x00)
LORANGE = RGBColor(0xFF, 0xF3, 0xE0)
YELLOW  = RGBColor(0xFF, 0xBF, 0x00)
GREEN   = RGBColor(0x1E, 0x8B, 0x4C)
LGREEN  = RGBColor(0xD5, 0xF5, 0xE3)
PURPLE  = RGBColor(0x6C, 0x35, 0x82)
LPURPLE = RGBColor(0xF0, 0xE6, 0xF6)
PINK    = RGBColor(0xFF, 0xC0, 0xCB)
GOLD    = RGBColor(0xB8, 0x86, 0x0B)
blank   = prs.slide_layouts[6]

# ── HELPERS ───────────────────────────────────────────────────────────────────
def rect(slide, x,y,w,h, clr):
    s = slide.shapes.add_shape(1, Inches(x),Inches(y),Inches(w),Inches(h))
    s.fill.solid(); s.fill.fore_color.rgb = clr
    s.line.fill.background()
    return s

def txt(slide, text, x,y,w,h, size=13, bold=False, italic=False,
        color=DARK, align=PP_ALIGN.LEFT, anchor=MSO_ANCHOR.TOP, wrap=True):
    tb = slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h))
    tf = tb.text_frame; tf.word_wrap = wrap; tf.vertical_anchor = anchor
    tf.margin_left=Pt(3); tf.margin_right=Pt(3)
    tf.margin_top=Pt(2);  tf.margin_bottom=Pt(2)
    p = tf.paragraphs[0]; p.alignment = align
    r = p.add_run(); r.text = text
    r.font.size=Pt(size); r.font.bold=bold; r.font.italic=italic
    r.font.color.rgb=color; r.font.name="Calibri"
    return tf

def mltxt(slide, lines, x,y,w,h, size=13, default_color=DARK):
    tb = slide.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h))
    tf = tb.text_frame; tf.word_wrap = True
    tf.margin_left=Pt(3); tf.margin_right=Pt(3)
    tf.margin_top=Pt(2);  tf.margin_bottom=Pt(2)
    for i, line in enumerate(lines):
        if isinstance(line, tuple) and len(line)==3: text,bld,clr = line
        elif isinstance(line, tuple) and len(line)==2: text,bld = line; clr=default_color
        else: text,bld,clr = line,False,default_color
        p = tf.paragraphs[0] if i==0 else tf.add_paragraph()
        p.alignment = PP_ALIGN.LEFT
        r = p.add_run(); r.text = text
        r.font.size=Pt(size); r.font.bold=bld
        r.font.color.rgb=clr; r.font.name="Calibri"
    return tf

def hdr(slide, title, sub=None, bg=NAVY):
    rect(slide,0,0,13.333,1.05,bg)
    rect(slide,0,1.05,13.333,0.07,TEAL)
    txt(slide,title,0.3,0.07,12.5,0.78,size=30,bold=True,
        color=WHITE,align=PP_ALIGN.LEFT,anchor=MSO_ANCHOR.MIDDLE)
    if sub:
        txt(slide,sub,0.3,0.7,12.5,0.38,size=13,color=SKY,align=PP_ALIGN.LEFT)

def footer(slide):
    rect(slide,0,7.15,13.333,0.35,NAVY)
    txt(slide,"Reference: Santhosh Kumar – Pediatric Clinical Methods  |  Textbook of Family Medicine 9e  |  Harriet Lane Handbook 23e",
        0.3,7.17,12.5,0.3,size=10,color=SKY,align=PP_ALIGN.LEFT)

def shdr(slide, title, x,y,w, h=0.42, clr=COBALT):
    rect(slide,x,y,w,h,clr)
    txt(slide,title,x+0.08,y+0.02,w-0.14,h-0.04,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)

def bul(slide, pts, x,y,w,h, size=12.5, bg=SKY, clr=DARK, row_h=None):
    rh = row_h if row_h else h/max(len(pts),1)
    for i,pt in enumerate(pts):
        yy=y+i*rh
        rect(slide,x,yy,w,rh-0.03, bg if i%2==0 else WHITE)
        txt(slide,"• "+pt, x+0.12,yy+0.04,w-0.2,rh-0.1,size=size,color=clr,anchor=MSO_ANCHOR.MIDDLE)

def two_col(slide, lt,lpts, rt,rpts, lc=COBALT,rc=TEAL, y=1.18, size=12.5):
    shdr(slide,lt,0.25,y,6.35,clr=lc)
    shdr(slide,rt,6.85,y,6.2,clr=rc)
    rh_l = min((7.0-y-0.55)/max(len(lpts),1), 0.72)
    rh_r = min((7.0-y-0.55)/max(len(rpts),1), 0.72)
    rh   = min(rh_l,rh_r)
    for i,pt in enumerate(lpts):
        yy=y+0.44+i*rh
        rect(slide,0.25,yy,6.35,rh-0.03,SKY if i%2==0 else WHITE)
        txt(slide,"• "+pt,0.38,yy+0.04,6.1,rh-0.1,size=size,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    for i,pt in enumerate(rpts):
        yy=y+0.44+i*rh
        rect(slide,6.85,yy,6.2,rh-0.03,MINT if i%2==0 else WHITE)
        txt(slide,"• "+pt,6.98,yy+0.04,5.95,rh-0.1,size=size,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 1 — TITLE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,NAVY)
rect(s,0,5.5,13.333,2.0,COBALT)
rect(s,0,7.1,13.333,0.4,TEAL)

txt(s,"NEWBORN EXAMINATION",0.5,0.55,12.3,1.4,size=50,bold=True,
    color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
txt(s,"Head-to-Toe  •  Reflexes  •  Kramer's Rule  •  Normal Findings",
    0.5,1.95,12.3,0.7,size=24,bold=True,color=YELLOW,
    align=PP_ALIGN.CENTER,anchor=PP_ALIGN.CENTER)
txt(s,"A Comprehensive Neonatal Clinical Assessment Guide",
    0.5,2.65,12.3,0.55,size=18,color=SKY,align=PP_ALIGN.CENTER)
rect(s,3.5,3.4,6.333,0.06,TEAL)
txt(s,"Reference: Santhosh Kumar – Pediatric Clinical Methods",
    0.5,3.55,12.3,0.48,size=17,bold=True,color=YELLOW,align=PP_ALIGN.CENTER)
txt(s,"Textbook of Family Medicine 9e  |  Harriet Lane Handbook 23e",
    0.5,4.05,12.3,0.4,size=14,color=SKY,align=PP_ALIGN.CENTER)
txt(s,"Neonatology  •  Pediatrics  •  Clinical Examination",
    0.5,7.12,12.3,0.34,size=12,color=WHITE,align=PP_ALIGN.CENTER)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 2 — CONTENTS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Contents — Newborn Examination")
footer(s)

topics=[
    ("01","APGAR Score"),("02","General Appearance & Vital Signs"),
    ("03","HEAD — Skull, Fontanelle, Sutures, Scalp"),
    ("04","FACE — Eyes, Ears, Nose, Mouth, Palate"),
    ("05","NECK & CLAVICLES"),
    ("06","CHEST — Respiratory, Heart Examination"),
    ("07","ABDOMEN — Liver, Spleen, Umbilicus"),
    ("08","GENITALIA & ANUS"),
    ("09","SPINE & BACK"),
    ("10","UPPER LIMBS — Brachial Plexus"),
    ("11","LOWER LIMBS — Hips (Ortolani & Barlow)"),
    ("12","SKIN — Normal Findings"),
    ("13","PRIMITIVE REFLEXES Part 1 (Moro, Rooting, Grasp)"),
    ("14","PRIMITIVE REFLEXES Part 2 (ATNR, Stepping, Galant)"),
    ("15","PRIMITIVE REFLEXES Part 3 (Parachute, Babinski, Sucking)"),
    ("16","KRAMER'S RULE — Jaundice Zones"),
    ("17","NORMAL NEWBORN VALUES (Quick Reference)"),
    ("18","RED FLAGS in Newborn Examination"),
]
for i,(num,topic) in enumerate(topics):
    ci = 0 if i<9 else 1
    ri = i if i<9 else i-9
    bx = 0.3+ci*6.55
    yy = 1.22+ri*0.66
    clr = COBALT if ci==0 else TEAL
    rect(s,bx,yy,0.55,0.6,clr)
    txt(s,num,bx,yy,0.55,0.6,size=12,bold=True,color=WHITE,
        align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx+0.55,yy,5.65,0.6,SKY if ri%2==0 else WHITE)
    txt(s,topic,bx+0.65,yy+0.04,5.45,0.52,size=13,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 3 — APGAR SCORE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"APGAR Score","Assessed at 1 minute and 5 minutes after birth")
footer(s)

shdr(s,"APGAR SCORE TABLE",0.25,1.22,12.8,clr=NAVY)
apgar_rows=[
    ("A","Appearance (Colour)","Blue/pale all over","Body pink, extremities blue","Pink all over"),
    ("P","Pulse (Heart Rate)","Absent","< 100 bpm","≥ 100 bpm"),
    ("G","Grimace (Reflex)","No response to stimulation","Grimace","Cry, cough, sneeze"),
    ("A","Activity (Muscle Tone)","Limp, no movement","Some flexion of limbs","Active motion, flexed"),
    ("R","Respiration","Absent","Slow, irregular, weak cry","Good, strong cry"),
]
rect(s,0.25,1.68,12.8,0.42,COBALT)
for lbl,cx,cw in zip(["Letter","Sign","Score 0","Score 1","Score 2"],
                       [0.32,0.92,3.2,6.1,9.0],[0.55,2.22,2.85,2.85,4.0]):
    txt(s,lbl,cx,1.7,cw,0.38,size=13,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
clrs_bg=[LRED, WHITE, SKY, WHITE, LGREEN]
for i,(let,sign,s0,s1,s2) in enumerate(apgar_rows):
    yy=2.12+i*0.88
    rect(s,0.25,yy,12.8,0.84,clrs_bg[i])
    rect(s,0.25,yy,0.58,0.84,NAVY)
    txt(s,let,0.25,yy,0.58,0.84,size=22,bold=True,color=WHITE,
        align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sign,0.88,yy+0.06,2.25,0.72,size=13,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,s0,3.2,yy+0.06,2.8,0.72,size=12.5,bold=True,color=RED,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,s1,6.1,yy+0.06,2.8,0.72,size=12.5,bold=True,color=ORANGE,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,s2,9.0,yy+0.06,4.05,0.72,size=12.5,bold=True,color=GREEN,anchor=MSO_ANCHOR.MIDDLE)

shdr(s,"INTERPRETATION",0.25,6.5,12.8,clr=TEAL)
interp="7–10 = Normal (Reassuring)   |   4–6 = Moderate Depression (Needs stimulation + O₂)   |   0–3 = Severe Depression (Requires active resuscitation)"
txt(s,interp,0.35,6.95,12.5,0.38,size=13,bold=True,color=DARK,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 4 — GENERAL APPEARANCE & VITAL SIGNS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"General Appearance & Vital Signs","First assessment before touching")
footer(s)

shdr(s,"GENERAL APPEARANCE",0.25,1.22,6.2,clr=NAVY)
gen=[
    "Colour: Pink centrally (normal); central cyanosis = pathological",
    "Posture: Flexed at rest (term); hypotonic = floppy infant",
    "Activity: Spontaneous movements, symmetric limb movements",
    "Cry: Strong lusty cry (normal); weak/high-pitched = encephalopathy",
    "Respiratory effort: Quiet, comfortable; no distress",
    "Skin texture: Smooth, vernix (white cheesy coating) — normal at term",
    "Body proportions: Head ~⅓ of body length",
    "Dysmorphic features: Note before full exam",
]
bul(s,gen,0.25,1.68,6.2,5.38,size=12,bg=SKY)

shdr(s,"VITAL SIGNS — NORMAL RANGE",6.85,1.22,6.2,clr=COBALT)
vs_rows=[
    ("Heart Rate","100–180 beats/min","Sleep: down to 80; Crying: up to 220"),
    ("Respiratory Rate","30–60 breaths/min","Periodic breathing is NORMAL"),
    ("Temperature","36.5–37.5°C (axillary)","Hypothermia <36.5°C is dangerous"),
    ("BP (Systolic)","60–90 mmHg at birth","Rises with gestation and days"),
    ("BP (Diastolic)","30–60 mmHg",""),
    ("SpO₂ (post-ductal)","≥95% after 10 minutes","Pre-ductal: right hand"),
    ("Blood Glucose","≥2.6 mmol/L (47 mg/dL)","Check in at-risk neonates"),
    ("Weight","2500–4000 g (term)","<2500g = LBW; >4000g = macrosomia"),
    ("Length","48–52 cm",""),
    ("Head Circ (OFC)","33–37 cm","Plot on growth chart"),
]
rect(s,6.85,1.68,6.2,0.36,NAVY)
for lbl,cx,cw in zip(["Parameter","Normal","Note"],[6.95,9.1,10.8],[2.1,1.65,2.1]):
    txt(s,lbl,cx,1.7,cw,0.32,size=11,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(par,val,note) in enumerate(vs_rows):
    yy=2.06+i*0.5
    bg=SKY if i%2==0 else WHITE
    rect(s,6.85,yy,6.2,0.48,bg)
    txt(s,par,6.95,yy+0.03,2.1,0.42,size=11.5,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,val,9.1,yy+0.03,1.65,0.42,size=11.5,bold=True,color=GREEN,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,note,10.8,yy+0.03,2.1,0.42,size=10.5,color=GRAY,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 5 — HEAD
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"HEAD Examination","Skull • Sutures • Fontanelle • Scalp")
footer(s)

boxes=[
    ("OFC / SKULL SHAPE",NAVY,[
        "Measure OFC (occipitofrontal circumference): 33–37 cm (term)",
        "Moulding: overriding sutures from birth canal — resolves in 1–2 days (NORMAL)",
        "Caput succedaneum: soft, pitting scalp oedema CROSSES sutures — resolves 1–3 days",
        "Cephalohaematoma: blood UNDER periosteum — does NOT cross sutures — firm, tense",
        "Subgaleal haematoma: DANGEROUS — blood above periosteum, crosses sutures, fluctuant",
        "Craniosynostosis: premature sutural fusion — ridged immobile suture",
    ]),
    ("FONTANELLES",COBALT,[
        "Anterior (bregma): diamond-shaped, 2–3 cm — closes 9–18 months",
        "Posterior (lambda): triangular, 0.5–1 cm — closes 6–8 weeks",
        "Normal: soft, flat, pulsating with heartbeat",
        "Bulging AF: ↑ICP — meningitis, hydrocephalus, bleed",
        "Sunken AF: dehydration",
        "Late closure: hypothyroidism, Down syndrome, rickets, hydrocephalus",
        "3rd fontanelle between anterior & posterior: Down syndrome",
    ]),
    ("SUTURES",TEAL,[
        "Sagittal (midline), Coronal (front), Metopic (front midline), Lambdoid (back)",
        "Normally: palpable soft gaps",
        "Separated (widened): ↑ICP",
        "Overriding (moulding): normal post-delivery, resolves 2–3 days",
        "Ridged/fused early: craniosynostosis",
    ]),
    ("SCALP",GREEN,[
        "Scalp hairs: fine lanugo hair — normal in premature infants",
        "Caput vs Cephalohaematoma: key differentiation (see above)",
        "Aplasia cutis: congenital absence of scalp skin",
        "Forceps marks / vacuum cup marks: note location",
    ]),
]
positions=[(0.25,1.22),(0.25,4.05),(6.85,1.22),(6.85,4.35)]
sizes=[(6.2,2.76),(6.2,2.76),(6.2,2.98),(6.2,2.64)]
for (bx,by),(bw,bh),(title,clr,pts) in zip(positions,sizes,boxes):
    rect(s,bx,by,bw,0.42,clr)
    txt(s,title,bx+0.1,by+0.02,bw-0.18,0.38,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    row_h=(bh-0.44)/max(len(pts),1)
    for i,pt in enumerate(pts):
        yy=by+0.44+i*row_h
        rect(s,bx,yy,bw,row_h-0.03,SKY if i%2==0 else WHITE)
        txt(s,"• "+pt,bx+0.12,yy+0.03,bw-0.2,row_h-0.06,size=12,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 6 — FACE: EYES, EARS, NOSE, MOUTH
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"FACE Examination","Eyes • Ears • Nose • Mouth & Palate")
footer(s)

face_boxes=[
    ("EYES",NAVY,[
        "Puffy eyelids: normal post-delivery",
        "Red reflex: check BOTH eyes — absent = cataract, retinoblastoma",
        "Subconjunctival haemorrhage: harmless, resolves 1–2 weeks",
        "Ophthalmia neonatorum: sticky eye, conjunctivitis",
        "Chemical: Credé's (silver nitrate) — first 24 h",
        "Gonococcal: profuse purulent, 2–5 days — EMERGENCY",
        "Chlamydial: mucopurulent, 5–14 days",
        "Coloboma, Brushfield spots (Down syndrome)",
    ]),
    ("EARS",COBALT,[
        "Position: helix at/above outer canthus of eye — low-set = dysmorphic",
        "Shape: normal folded pinna architecture",
        "Preauricular tags/pits: assess for renal anomalies",
        "Otoacoustic emissions (OAE): universal hearing screen",
        "Ear canal may have vernix — do not probe",
    ]),
    ("NOSE",TEAL,[
        "Neonates are OBLIGATE nasal breathers — check patency",
        "Choanal atresia: bilateral — respiratory distress relieved by crying",
        "Test: hold mouth closed, occlude each nostril — watch for distress",
        "Nasal bridge: flat in Down syndrome, Achondroplasia",
        "Millia: tiny white cysts on nose tip — NORMAL, resolves days-weeks",
    ]),
    ("MOUTH & PALATE",GREEN,[
        "Cleft lip/palate: inspect + palpate hard and soft palate with finger",
        "Epstein pearls: white cysts at midline palate — NORMAL",
        "Bohn's nodules: similar cysts on gum margins — NORMAL",
        "Tongue: macroglossia (Beckwith-Wiedemann, Down, hypothyroidism)",
        "Ankyloglossia (tongue-tie): short frenulum — may affect feeding",
        "Neonatal teeth: natal (present at birth) — risk of aspiration",
        "Micrognathia: small jaw — Pierre Robin sequence",
        "Thrush (Candida): white plaques on tongue/buccal mucosa",
    ]),
]
positions2=[(0.25,1.22),(6.85,1.22),(0.25,4.3),(6.85,4.06)]
sizes2=[(6.2,3.0),(6.2,2.72),(6.2,2.72),(6.2,2.96)]
for (bx,by),(bw,bh),(title,clr,pts) in zip(positions2,sizes2,face_boxes):
    rect(s,bx,by,bw,0.42,clr)
    txt(s,title,bx+0.1,by+0.02,bw-0.18,0.38,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    row_h=(bh-0.44)/max(len(pts),1)
    for i,pt in enumerate(pts):
        yy=by+0.44+i*row_h
        rect(s,bx,yy,bw,row_h-0.03,SKY if i%2==0 else WHITE)
        txt(s,"• "+pt,bx+0.12,yy+0.03,bw-0.2,row_h-0.06,size=12,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 7 — NECK, CLAVICLES, CHEST
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Neck, Clavicles & Chest Examination")
footer(s)

two_col(s,
    "NECK",
    ["Short neck: Turner syndrome, Klippel-Feil",
     "Webbing of neck: Turner syndrome",
     "Torticollis: SCM haematoma (birth injury) — head tilted, chin to opposite side",
     "Cystic hygroma: soft, fluctuant, transilluminates",
     "Thyroglossal cyst: midline, moves with swallowing",
     "Branchial cyst: lateral neck, along anterior SCM",
     "Clavicle: palpate for fracture (birth injury) — crepitus, swelling, limited arm movement",
     "Moro reflex asymmetry + clavicle tenderness = fracture"],
    "CHEST",
    ["Shape: barrel chest (hyperinflation), pectus excavatum/carinatum",
     "RR: 30–60 breaths/min; periodic breathing is NORMAL in neonates",
     "Grunting: normal first 1 hour only; persistent = RDS",
     "Nasal flaring, subcostal/intercostal/sternal recession = respiratory distress",
     "Breast tissue: 3–5 mm nodule palpable bilaterally — NORMAL (maternal oestrogen)",
     "Witch's milk: milky secretion from breast — NORMAL (do NOT squeeze)",
     "Supernumerary nipples: along milk line — check renal anomalies",
     "Heart: apex beat 4th intercostal space; rate 100–180 bpm",
     "Soft systolic murmur in first 24 h: PDA or peripheral pulmonary stenosis — often NORMAL"],
    lc=NAVY,rc=COBALT,y=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 8 — ABDOMEN
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Abdomen Examination","Inspection • Palpation • Umbilicus")
footer(s)

two_col(s,
    "INSPECTION & PALPATION",
    ["Shape: slightly prominent (normal); scaphoid = diaphragmatic hernia",
     "Distension: gut obstruction, ascites, organomegaly",
     "Liver: palpable 1–2 cm below right costal margin — NORMAL",
     "Spleen: tip palpable in some — if >3 cm, pathological",
     "Kidneys: palpable in neonate (deep ballottement) — horseshoe kidney",
     "Abdominal mass: Wilms' tumour, neuroblastoma, posterior — investigate",
     "Bladder: palpable if distended — posterior urethral valves in males",
     "Bowel sounds: present after 1–2 hours of life"],
    "UMBILICUS",
    ["Umbilical cord: Wharton's jelly — 3 vessels (2 arteries + 1 vein)",
     "Single umbilical artery: associated with renal anomalies (10–15%)",
     "Umbilical hernia: common, especially in African descent — closes by 2–4 years",
     "Exomphalos (omphalocele): covered by sac at umbilicus — chromosomal associations",
     "Gastroschisis: bowel herniates through abdominal wall defect RIGHT of umbilicus — NO sac",
     "Cord separation: normally falls off 7–10 days",
     "Urachus patent: urine dribbles from umbilicus",
     "Periumbilical redness/smell: omphalitis — serious neonatal infection"],
    lc=NAVY,rc=COBALT,y=1.18)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 9 — GENITALIA, ANUS, SPINE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Genitalia, Anus & Spine")
footer(s)

shdr(s,"MALE GENITALIA",0.25,1.22,4.0,clr=COBALT)
male=["Testes: both should be palpable in scrotum at term",
      "Cryptorchidism: undescended testis — check inguinal canal",
      "Hydrocele: transilluminates — common, resolves by 12 months",
      "Hypospadias: urethral meatus NOT at tip — do NOT circumcise",
      "Epispadias: meatus on dorsum of penis",
      "Phimosis: tight prepuce — NORMAL at birth",
      "Scrotal swelling: examine for hernia, torsion"]
bul(s,male,0.25,1.68,4.0,5.28,size=12,bg=SKY)

shdr(s,"FEMALE GENITALIA",4.45,1.22,4.0,clr=TEAL)
female=["Labia majora covers minora at term (premature: minora visible)",
        "Vaginal discharge: milky/white/blood-tinged — NORMAL (maternal oestrogen withdrawal)",
        "Hymenal tag: small skin tag — disappears with time",
        "Hydrocolpos: distended vagina (imperforate hymen) — bluish bulge",
        "Clitoromegaly: congenital adrenal hyperplasia (CAH) — urgent",
        "Ambiguous genitalia: URGENT — karyotype, cortisol, 17-OHP",
        "Labial adhesions: can occur later, not typically at birth"]
bul(s,female,4.45,1.68,4.0,5.28,size=12,bg=MINT)

shdr(s,"ANUS & SPINE",8.65,1.22,4.45,clr=GREEN)
anus=["Anus: confirm patency — pass thermometer/little finger",
      "Imperforate anus: no meconium in 48 h — inspect carefully",
      "Anal position: normal; ectopic anterior = anteriorly displaced anus",
      "SPINE: inspect and palpate entire spine prone",
      "Spina bifida occulta: dimple, hairy patch, skin tag over lumbar spine",
      "Myelomeningocele: open sac with neural tissue — cover, urgent",
      "Sacral dimple: >5mm deep, off midline — needs imaging (tethered cord)",
      "Coccygeal dimple: midline, shallow — usually benign"]
bul(s,anus,8.65,1.68,4.45,5.28,size=12,bg=SKY)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 10 — LIMBS & HIPS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Limbs, Hands, Feet & Hip Examination","Ortolani • Barlow • DDH screening")
footer(s)

two_col(s,
    "UPPER & LOWER LIMBS",
    ["Count fingers and toes (polydactyly / syndactyly)",
     "Palmar creases: single palmar crease (simian crease) — Down syndrome",
     "Clinodactyly: curved 5th finger — Down, Turner syndrome",
     "Talipes equinovarus (clubfoot): foot plantar flexed + inverted",
     "Talipes calcaneovalgus: foot dorsiflexed + everted (positional — resolves)",
     "Rocker-bottom foot: congenital vertical talus — Patau/Edwards syndrome",
     "Erb's palsy (C5/C6): 'waiter's tip' — arm adducted, elbow extended, wrist flexed",
     "Klumpke's palsy (C8/T1): claw hand, paralysis of intrinsic muscles",
     "Fracture femur: limited movement, swelling, crepitus"],
    "HIP EXAMINATION — DDH SCREENING",
    ["Developmental Dysplasia of the Hip (DDH) — screen ALL newborns",
     "ORTOLANI TEST: reduction test",
     "   Flex hip 90°, abduct gently — feel/hear a 'clunk' = positive",
     "   Confirms dislocated hip being REDUCED into acetabulum",
     "BARLOW TEST: dislocation test",
     "   Flex hip 90°, adduct + gentle posterior pressure",
     "   Feel hip DISLOCATING = positive (unstable hip)",
     "Risk factors: female, breech, family history, oligohydramnios",
     "Asymmetric skin folds, limited abduction, leg length discrepancy",
     "USS hips if risk factors present; X-ray if >3 months"],
    lc=NAVY,rc=TEAL,y=1.18,size=12.5)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 11 — SKIN FINDINGS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Normal Skin Findings in the Newborn","Reassure parents — most are benign and transient")
footer(s)

skin_data=[
    (GREEN,"NORMAL / REASSURE",[
        ("Vernix caseosa","White cheesy coating — protective, absorbs over 1–2 days"),
        ("Lanugo","Fine soft hair — shed by 36–40 weeks; more in premature"),
        ("Milia","Tiny white keratin cysts on nose/cheeks — resolve weeks"),
        ("Erythema toxicum","Blotchy red rash + white/yellow papules — peaks 24–72 h, resolves 5–7 days"),
        ("Mongolian blue spot","Blue-grey patch on lower back/buttocks — common in Asian/African infants, fades by age 5"),
        ("Salmon patch (stork bite)","Flat pink/red patch — nape of neck, eyelids, forehead — fades by age 2"),
        ("Transient neonatal pustular melanosis","Vesicles → pustules → brown macules — benign"),
        ("Harlequin colour change","One side red, one side pale — positional, benign, transient"),
        ("Cutis marmorata","Mottled skin in cold — normal if disappears on rewarming"),
    ]),
    (RED,"PATHOLOGICAL / INVESTIGATE",[
        ("Port wine stain (naevus flammeus)","Permanent, unilateral face → Sturge-Weber syndrome (leptomeningeal angioma)"),
        ("Strawberry haemangioma","Appears 1–4 weeks, grows rapidly — usually involutes by age 7"),
        ("Café-au-lait spots","≥6 or >5 mm → Neurofibromatosis type 1"),
        ("Vesicles/blisters at birth","Herpes simplex — URGENT (culture, treat aciclovir)"),
        ("Impetigo","Bullous — Staphylococcus aureus — requires treatment"),
        ("Neonatal lupus","Annular red ring lesions — maternal anti-Ro/La antibodies"),
    ]),
]
bw_s,by_s = 6.2,1.22
for ci,(clr,label,entries) in enumerate(skin_data):
    bx=0.25 if ci==0 else 6.85
    bw_use=bw_s
    rect(s,bx,by_s,bw_use,0.42,clr)
    txt(s,label,bx+0.1,by_s+0.02,bw_use-0.18,0.38,size=14,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    row_h=5.42/len(entries)
    for i,(name,desc) in enumerate(entries):
        yy=by_s+0.44+i*row_h
        bg2=LGREEN if ci==0 else LRED
        rect(s,bx,yy,bw_use,row_h-0.03,bg2 if i%2==0 else WHITE)
        txt(s,name,bx+0.12,yy+0.03,2.5,row_h-0.06,size=12,bold=True,color=clr,anchor=MSO_ANCHOR.MIDDLE)
        txt(s,desc,bx+2.65,yy+0.03,bw_use-2.75,row_h-0.06,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 12 — PRIMITIVE REFLEXES PART 1
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Neonatal Primitive Reflexes — Part 1","Moro • Rooting • Sucking • Palmar Grasp")
footer(s)

ref1=[
    (NAVY,"MORO REFLEX","Birth","4–6 months",
     "Hold infant semi-upright (30–40°). Suddenly lower head by ~3 cm OR make a sudden loud noise.",
     "PHASE 1: Arms ABDUCT + EXTEND + hands OPEN\nPHASE 2: Arms ADDUCT (embrace) + flex + cry",
     "Asymmetric: brachial plexus palsy, fracture clavicle/humerus\nAbsent: HIE, severe encephalopathy, sedation\nPersistence >6 months: cerebral palsy"),
    (COBALT,"ROOTING REFLEX","Birth","3–4 months",
     "Stroke corner of mouth / cheek with fingertip.",
     "Head TURNS toward stimulus, mouth opens, tongue moves toward stimulus",
     "Absent: severe CNS depression\nPersistence >4 months: frontal lobe damage\nHelps with breastfeeding initiation"),
    (TEAL,"SUCKING REFLEX","Birth","3–4 months",
     "Place clean finger or nipple into mouth.",
     "Rhythmic sucking movements begin; coordinated with swallowing",
     "Absent or weak: prematurity, HIE, sedation, bulbar palsy\nNon-nutritive sucking calms neonate\nCoordination with swallowing essential for feeding"),
    (GREEN,"PALMAR GRASP","Birth","3–6 months",
     "Place finger against infant's palm (ulnar side).",
     "Fingers FLEX and GRASP firmly — involuntary, cannot open voluntarily",
     "Asymmetric: contralateral hemisphere lesion, brachial plexus injury\nPersistence >6 months: UMN lesion, CP\nGrasp reflex used to PULL infant: traction on arms, infant's head follows"),
]

bw_r,by_r=3.1,1.18
for i,(clr,name,appears,disapp,method,response,abnormal) in enumerate(ref1):
    bx=0.25+i*3.27
    rect(s,bx,by_r,bw_r,0.5,clr)
    txt(s,name,bx+0.06,by_r+0.02,bw_r-0.1,0.24,size=14,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,f"Appears: {appears}   |   Disappears: {disapp}",
        bx+0.06,by_r+0.26,bw_r-0.1,0.2,size=10,italic=True,
        color=YELLOW,anchor=MSO_ANCHOR.MIDDLE)

    rect(s,bx,by_r+0.52,bw_r,0.32,NAVY)
    txt(s,"HOW TO ELICIT",bx+0.08,by_r+0.52,bw_r-0.12,0.3,size=10.5,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r+0.84,bw_r,1.22,SKY)
    txt(s,method,bx+0.1,by_r+0.88,bw_r-0.18,1.14,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

    rect(s,bx,by_r+2.08,bw_r,0.32,clr)
    txt(s,"NORMAL RESPONSE",bx+0.08,by_r+2.08,bw_r-0.12,0.3,size=10.5,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r+2.4,bw_r,1.26,MINT)
    txt(s,response,bx+0.1,by_r+2.44,bw_r-0.18,1.18,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

    rect(s,bx,by_r+3.68,bw_r,0.3,RED)
    txt(s,"ABNORMAL / CLINICAL SIGNIFICANCE",bx+0.06,by_r+3.68,bw_r-0.1,0.28,size=9.5,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r+3.98,bw_r,1.84,LRED)
    txt(s,abnormal,bx+0.1,by_r+4.02,bw_r-0.18,1.76,size=11,color=RED,anchor=MSO_ANCHOR.MIDDLE)

footer(s)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 13 — PRIMITIVE REFLEXES PART 2
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Neonatal Primitive Reflexes — Part 2","ATNR • Stepping • Galant • Plantar Grasp")
footer(s)

ref2=[
    (COBALT,"ATNR\n(Fencer Reflex)","Birth","4–6 months",
     "With infant supine, turn head to one side.",
     "Extension of limbs on FACE side\nFlexion of limbs on SKULL side\n(Resembles fencing position)",
     "Obligatory ATNR (cannot break): severe CNS damage\nPersistence >6 months: hemiplegic CP\nInterferes with midline activity and rolling"),
    (TEAL,"STEPPING REFLEX\n(Walking Reflex)","Birth","2–3 months",
     "Hold infant upright under axillae; let soles touch flat surface.",
     "Alternating stepping-walking movements of legs",
     "Absence: lower limb injury, severe hypotonia\nPremature: more pronounced\nNote: disappears BEFORE voluntary walking — then re-emerges"),
    (PURPLE,"GALANT REFLEX\n(Truncal Incurvation)","Birth","4–6 months",
     "Hold infant prone (or in ventral suspension).\nStroke skin lateral to spine from shoulder to buttock.",
     "TRUNK CURVES toward the stroked side (lateral flexion)",
     "Absence: may indicate spinal cord lesion\nPersistence: may interfere with sitting balance\nAsymmetric: ipsilateral spinal cord injury"),
    (GREEN,"PLANTAR GRASP","Birth","9–12 months",
     "Press thumb firmly on ball of foot (below toes).",
     "Toes FLEX and curl downward (plantar flexion of all toes)",
     "Absent: L4–S1 nerve dysfunction\nPersistence beyond 12 months: UMN lesion\nDistinct from Babinski (dorsiflexion of big toe)"),
]
for i,(clr,name,appears,disapp,method,response,abnormal) in enumerate(ref2):
    bx=0.25+i*3.27
    bw_r2=3.1
    by_r2=1.18
    rect(s,bx,by_r2,bw_r2,0.5,clr)
    txt(s,name,bx+0.06,by_r2+0.02,bw_r2-0.1,0.28,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,f"Appears: {appears}  |  Disappears: {disapp}",
        bx+0.06,by_r2+0.3,bw_r2-0.1,0.18,size=10,italic=True,color=YELLOW)
    rect(s,bx,by_r2+0.52,bw_r2,0.32,NAVY)
    txt(s,"ELICITATION",bx+0.08,by_r2+0.52,bw_r2-0.12,0.3,size=10.5,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r2+0.84,bw_r2,1.28,SKY)
    txt(s,method,bx+0.1,by_r2+0.88,bw_r2-0.18,1.2,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r2+2.14,bw_r2,0.3,clr)
    txt(s,"NORMAL RESPONSE",bx+0.08,by_r2+2.14,bw_r2-0.12,0.28,size=10.5,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r2+2.44,bw_r2,1.22,MINT)
    txt(s,response,bx+0.1,by_r2+2.48,bw_r2-0.18,1.14,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r2+3.68,bw_r2,0.3,RED)
    txt(s,"ABNORMAL / SIGNIFICANCE",bx+0.06,by_r2+3.68,bw_r2-0.1,0.28,size=9.5,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    rect(s,bx,by_r2+3.98,bw_r2,1.84,LRED)
    txt(s,abnormal,bx+0.1,by_r2+4.02,bw_r2-0.18,1.76,size=11,color=RED,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 14 — PRIMITIVE REFLEXES PART 3 + BABINSKI
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Neonatal Reflexes — Part 3 & Summary Table","Parachute • Babinski • Tonic labyrinthine • Summary")
footer(s)

shdr(s,"PARACHUTE REFLEX",0.25,1.22,4.0,clr=TEAL)
para_pts=["Appears: 8–9 months | PERSISTS lifelong",
          "Hold infant prone horizontally, then tilt suddenly towards floor",
          "Normal response: arms EXTEND + ABDUCT, hands OPEN — protective",
          "Absence or asymmetry after 12 months = serious UMN concern",
          "Asymmetric: hemiplegic cerebral palsy",
          "It is the first PROTECTIVE (not primitive) postural reflex"]
bul(s,para_pts,0.25,1.68,4.0,2.9,size=12,bg=MINT)

shdr(s,"BABINSKI SIGN",4.45,1.22,4.0,clr=COBALT)
babi=["Stroke lateral aspect of sole with blunt pin, heel to toe",
      "NORMAL in neonates: extensor response (upgoing great toe + fan other toes)",
      "Physiologically normal up to 12–18 months",
      "Pathological AFTER 18 months = UMN (corticospinal tract) lesion",
      "Variants: Chaddock, Oppenheim, Gordon — same significance",
      "Equivocal response: ticklish child withdraws — note carefully"]
bul(s,babi,4.45,1.68,4.0,2.9,size=12,bg=SKY)

shdr(s,"TONIC LABYRINTHINE REFLEX",8.65,1.22,4.45,clr=PURPLE)
tonic=["Appears: birth | Disappears: 6 months",
       "Supine position: increased extensor tone (back arches)",
       "Prone position: increased flexor tone (curls forward)",
       "Persistence: interferes with head control and rolling",
       "Persistence >6 months: cerebral palsy (especially spastic quadriplegia)"]
bul(s,tonic,8.65,1.68,4.45,2.9,size=12,bg=LPURPLE)

# SUMMARY TABLE
shdr(s,"PRIMITIVE REFLEX DISAPPEARANCE SUMMARY",0.25,4.68,12.8,clr=NAVY)
prim_sum=[
    ("Moro","Birth","4–6 months","Absence / asymmetry = palsy, HIE"),
    ("Rooting","Birth","3–4 months","Persistence >1 yr = frontal damage"),
    ("Sucking","Birth","3–4 months","Weak = prematurity, HIE"),
    ("Palmar Grasp","Birth","3–6 months","Persistence = UMN lesion"),
    ("Plantar Grasp","Birth","9–12 months","Persistence = UMN"),
    ("ATNR","Birth","4–6 months","Obligatory = severe CNS damage"),
    ("Stepping","Birth","2–3 months","Persists then re-emerges as voluntary"),
    ("Galant","Birth","4–6 months","Absence = spinal cord lesion"),
    ("Parachute","8–9 mo","Persists","Asymmetric = hemiplegia"),
    ("Babinski","Birth","12–18 mo","After 18 mo = UMN pathology"),
]
rect(s,0.25,5.12,12.8,0.36,COBALT)
for lbl,cx,cw in zip(["Reflex","Appears","Disappears","Clinical significance"],
                       [0.32,2.5,3.75,5.4],[2.1,1.2,1.6,7.65]):
    txt(s,lbl,cx,5.14,cw,0.32,size=11,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(name,app,dis,sig) in enumerate(prim_sum):
    yy=5.5+i*0.19
    bg=SKY if i%2==0 else WHITE
    dis_c=GREEN if "Persists" in dis else DARK
    rect(s,0.25,yy,12.8,0.19,bg)
    txt(s,name,0.32,yy+0.01,2.1,0.17,size=10,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,app,2.52,yy+0.01,1.15,0.17,size=10,color=GRAY,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,dis,3.78,yy+0.01,1.55,0.17,size=10,bold=True,color=dis_c,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,sig,5.45,yy+0.01,7.5,0.17,size=10,color=RED,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 15 — KRAMER'S RULE
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Kramer's Rule — Clinical Assessment of Neonatal Jaundice",
    "Cephalocaudal progression of jaundice correlates with serum bilirubin level")
footer(s)

shdr(s,"PRINCIPLE",0.25,1.22,12.8,clr=NAVY)
txt(s,"Jaundice in neonates progresses in a predictable CEPHALOCAUDAL (head to toe) direction as bilirubin levels rise. "
      "Kramer (1969) described 5 zones that correlate with approximate serum bilirubin. "
      "Press firmly on skin to blanch — assess colour of blanched area in natural light.",
    0.35,1.68,12.5,0.72,size=13,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

kramer=[
    (1,"Zone 1: HEAD & NECK (Face/scalp)",   "~5–6 mg/dL (85–103 µmol/L)",  YELLOW,   "Scleral icterus is the FIRST sign — check sclerae first"),
    (2,"Zone 2: CHEST to UMBILICUS",          "~9–10 mg/dL (154–171 µmol/L)", RGBColor(0xFF,0xA5,0x00), "Jaundice visible on trunk"),
    (3,"Zone 3: ABDOMEN below umbilicus to THIGHS","~11–12 mg/dL (188–205 µmol/L)", ORANGE,"Approaches phototherapy threshold"),
    (4,"Zone 4: ARMS & LEGS (below knees/elbows)","~12–14 mg/dL (205–239 µmol/L)", RED,  "Usually REQUIRES phototherapy"),
    (5,"Zone 5: PALMS & SOLES",               "≥15 mg/dL (≥256 µmol/L)",      RGBColor(0x8B,0x00,0x00),"URGENT — high risk kernicterus; immediate exchange transfusion evaluation"),
]
by_k=2.5
rect(s,0.25,by_k,12.8,0.38,COBALT)
for lbl,cx,cw in zip(["Zone","Body Area","~Bilirubin Level","Action"],
                       [0.32,0.92,5.0,9.2],[0.55,4.0,4.1,3.9]):
    txt(s,lbl,cx,by_k+0.02,cw,0.34,size=12,bold=True,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
for i,(zone,area,bili,clr,action) in enumerate(kramer):
    yy=by_k+0.4+i*0.82
    rect(s,0.25,yy,12.8,0.8,RGBColor(0xFF,0xFF,0xCC) if i%2==0 else WHITE)
    rect(s,0.25,yy,0.58,0.8,clr)
    txt(s,str(zone),0.25,yy,0.58,0.8,size=24,bold=True,color=WHITE,
        align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,area,0.92,yy+0.06,4.0,0.66,size=12.5,bold=True,color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,bili,5.05,yy+0.06,4.05,0.66,size=13,bold=True,color=clr,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,action,9.25,yy+0.06,3.7,0.66,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

rect(s,0.25,6.64,12.8,0.42,LORANGE)
txt(s,"⚠ LIMITATIONS: Kramer's zones are a SCREENING TOOL only — NOT a replacement for serum/transcutaneous bilirubin. "
      "Dark-skinned infants are harder to assess. Always confirm with lab measurement before treatment decisions.",
    0.38,6.66,12.5,0.38,size=12,bold=True,color=ORANGE,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 16 — NORMAL NEWBORN VALUES
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Normal Newborn Findings — Quick Reference","Common normal findings that require reassurance, not investigation")
footer(s)

norm_data=[
    ("VITAL SIGNS",NAVY,[
        ("Heart rate","100–180 bpm (sleep: ~80; crying: ~220)"),
        ("Respiratory rate","30–60/min — periodic breathing NORMAL"),
        ("Temperature","36.5–37.5°C axillary"),
        ("BP Systolic / Diastolic","60–90 / 30–60 mmHg"),
        ("SpO₂ (post 10 min)","≥ 95% (pre-ductal right hand)"),
    ]),
    ("ANTHROPOMETRY",COBALT,[
        ("Birth weight (term)","2500–4000 g"),
        ("Weight loss (normal)","Up to 7–10% in first 3–5 days"),
        ("Weight regain","Birth weight by 10–14 days"),
        ("Length","48–52 cm"),
        ("Head circumference","33–37 cm"),
    ]),
    ("SKIN (NORMAL)",GREEN,[
        ("Vernix caseosa","Normal protective coating"),
        ("Milia","White cysts on nose — benign"),
        ("Erythema toxicum","Blotchy rash — benign, peaks 24–72 h"),
        ("Mongolian blue spot","Asian/African infants — benign"),
        ("Subconjunctival haem","Common — resolves 1–2 weeks"),
    ]),
    ("FEEDING & STOOLS",TEAL,[
        ("First void","Within 24 hours of birth"),
        ("Meconium","Within 48 hours — dark, sticky"),
        ("Transitional stool","Green-brown by day 3–4"),
        ("Breastfed stool","Yellow, seedy, frequent (normal)"),
        ("Witch's milk","Milky breast secretion — maternal hormone withdrawal"),
    ]),
    ("GENITALIA & MISC",PURPLE,[
        ("Vaginal discharge","Milky/blood-tinged — maternal oestrogen withdrawal"),
        ("Breast nodule","3–5 mm bilateral — normal in both sexes"),
        ("Umbilical cord","Falls off 7–10 days"),
        ("Soft systolic murmur","First 24 h — usually PDA/peripheral PS"),
        ("Moulding / overriding sutures","Birth canal compression — resolves 1–2 days"),
    ]),
    ("LAB VALUES",ORANGE,[
        ("Haemoglobin","140–220 g/L at birth"),
        ("Hct","0.44–0.64"),
        ("WBC","9–30 × 10⁹/L"),
        ("Platelets","150–400 × 10⁹/L"),
        ("Blood glucose","≥ 2.6 mmol/L (47 mg/dL)"),
    ]),
]
bw9=4.1
for i,(title,clr,rows) in enumerate(norm_data):
    ci=i%2; ri=i//2
    bx=0.25 if ci==0 else 6.85
    by2=1.22+ri*2.02
    bw_u=bw9 if ci==0 else 6.2
    bh_u=1.96
    rect(s,bx,by2,bw_u,0.4,clr)
    txt(s,title,bx+0.08,by2+0.02,bw_u-0.14,0.36,size=13,bold=True,
        color=WHITE,anchor=MSO_ANCHOR.MIDDLE)
    row_h=(bh_u-0.42)/len(rows)
    for j,(label,val) in enumerate(rows):
        yy=by2+0.42+j*row_h
        rect(s,bx,yy,bw_u,row_h-0.02,SKY if j%2==0 else WHITE)
        txt(s,label,bx+0.12,yy+0.02,2.5,row_h-0.04,size=12,bold=True,
            color=NAVY,anchor=MSO_ANCHOR.MIDDLE)
        txt(s,val,bx+2.65,yy+0.02,bw_u-2.75,row_h-0.04,size=12,
            color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 17 — RED FLAGS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,OFFWHITE)
hdr(s,"Red Flags in Newborn Examination","Requires urgent evaluation and management")
footer(s)

urgent=[
    "Central cyanosis persisting beyond first 10 minutes",
    "Respiratory distress: grunting, severe recession, RR >60/min persistently",
    "Absent or bilateral red reflex — urgent ophthalmology",
    "Bulging fontanelle — ↑ICP (meningitis, haemorrhage)",
    "Absent Moro OR asymmetric Moro bilaterally",
    "Absent cry or very high-pitched monotonous cry",
    "Flaccid hypotonia — floppy infant without explanation",
    "Absent bowel sounds + distended abdomen — obstruction",
]
important=[
    "No meconium within 48 hours — Hirschsprung's, imperforate anus",
    "No urine within 24 hours — renal agenesis, posterior urethral valves",
    "Single umbilical artery — renal USS recommended",
    "Ambiguous genitalia — karyotype + endocrine urgent evaluation",
    "Low-set ears + renal anomalies association — refer",
    "Cleft palate — feeding assessment + ENT/plastic surgery referral",
    "Myelomeningocele — cover sterile, urgent neurosurgery",
    "Absent anal opening — urgent surgical referral",
]
early=[
    "Preauricular skin tags/pits — hearing screen + renal USS",
    "Sacral dimple >5mm off midline — spinal USS",
    "Cephalohaematoma crossing sutures → subgaleal — monitor FBC/bilirubin",
    "Erb's palsy — physiotherapy + orthopaedic review",
    "DDH positive Barlow/Ortolani — USS hips",
    "Absent red reflex — retinoblastoma, cataract",
    "Inguinal hernia — surgical referral (risk of incarceration)",
    "Hypospadias — urology referral (do NOT circumcise)",
]
shdr(s,"EMERGENCY — ACT IMMEDIATELY",0.22,1.22,4.25,clr=RED)
shdr(s,"URGENT — SAME DAY",4.72,1.22,4.25,clr=ORANGE)
shdr(s,"EARLY REFERRAL — WITHIN DAYS",9.22,1.22,4.22,clr=COBALT)
for grp,bx,bg in [(urgent,0.22,LRED),(important,4.72,LORANGE),(early,9.22,SKY)]:
    for i,flag in enumerate(grp):
        yy=1.66+i*0.69
        rect(s,bx,yy,4.25,0.67,bg if i%2==0 else WHITE)
        rect(s,bx,yy,0.3,0.67,RED if bx<4 else (ORANGE if bx<8 else COBALT))
        txt(s,flag,bx+0.35,yy+0.06,3.75,0.58,size=11.5,color=DARK,anchor=MSO_ANCHOR.MIDDLE)

# ════════════════════════════════════════════════════════════════════════════
#  SLIDE 18 — SUMMARY PEARLS
# ════════════════════════════════════════════════════════════════════════════
s = prs.slides.add_slide(blank)
rect(s,0,0,13.333,7.5,NAVY)
rect(s,0,5.6,13.333,1.9,COBALT)
rect(s,0,7.1,13.333,0.4,TEAL)

txt(s,"Key Clinical Pearls — Newborn Examination",0.5,0.2,12.3,0.9,size=30,bold=True,
    color=YELLOW,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)

pearls=[
    "Examine in WARM ROOM with good light — undress fully but keep warm",
    "OBSERVE before touching: colour, posture, activity, breathing, cry",
    "Check 3 umbilical vessels: 2 arteries + 1 vein; single artery → renal USS",
    "RED REFLEX both eyes before discharge — absent = urgent ophthalmology",
    "APGAR at 1 and 5 min; if <7 at 5 min, repeat every 5 min to 20 min",
    "Kramer's zones: jaundice spreads head→toe as bilirubin rises; Zone 4–5 = treat",
    "Ortolani (reduces dislocated hip) + Barlow (dislocates unstable hip) — screen ALL",
    "Moro reflex: asymmetric = fracture clavicle / Erb's palsy; absent = HIE",
    "No meconium 48 h → Hirschsprung's; no urine 24 h → renal/bladder anomaly",
    "Weight loss up to 10% is normal; back to birth weight by day 10–14",
]
for i,pearl in enumerate(pearls):
    y=1.18+i*0.56
    rect(s,0.45,y,0.5,0.5,TEAL)
    txt(s,str(i+1),0.45,y,0.5,0.5,size=16,bold=True,
        color=WHITE,align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
    txt(s,pearl,1.05,y+0.04,11.7,0.44,size=14,color=WHITE,anchor=MSO_ANCHOR.MIDDLE)

txt(s,"Reference: Santhosh Kumar — Pediatric Clinical Methods",
    0.5,5.72,12.3,0.5,size=18,bold=True,color=YELLOW,
    align=PP_ALIGN.CENTER,anchor=MSO_ANCHOR.MIDDLE)
txt(s,"Textbook of Family Medicine 9e  |  Harriet Lane Handbook 23e  |  Nelson's Pediatrics",
    0.5,6.28,12.3,0.42,size=14,color=WHITE,align=PP_ALIGN.CENTER)

# ─── SAVE ─────────────────────────────────────────────────────────────────────
out="/tmp/workspace/cns-peds-ppt/Newborn_Examination_Complete.pptx"
buf=BytesIO()
prs.save(buf)
with open(out,"wb") as f: f.write(buf.getvalue())
print(f"Saved: {out}  |  Slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/cns-peds-ppt && python newborn_exam_ppt.py 2>&1

Editing File

~/cns-peds-ppt/newborn_exam_ppt.py

Successfully replaced 1 instance(s) of the string in '/tmp/workspace/cns-peds-ppt/newborn_exam_ppt.py'
Running Command

cd /tmp/workspace/cns-peds-ppt && python newborn_exam_ppt.py 2>&1

Running Command

python -c " from pptx import Presentation prs = Presentation('/tmp/workspace/cns-peds-ppt/Newborn_Examination_Complete.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): t = [s.text_frame.text.strip()[:65] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] print(f' Slide {i:02d}: {t[0] if t else \"blank\"}') "

Your PPT is ready!

Newborn Examination Complete

Presentation · PPTX


18 Slides — Complete Content:
#SlideWhat's Inside
1TitleNewborn Examination — Head to Toe
2Contents18-topic colour-coded index
3APGAR ScoreFull table — each letter, scoring 0/1/2, interpretation (7–10 / 4–6 / 0–3)
4General Appearance & Vital SignsColour, posture, cry, RR, HR, BP, SpO2, blood glucose, weight, OFC normal ranges
5HEADOFC, moulding, caput succedaneum vs cephalohaematoma vs subgaleal (differentiating), fontanelles, sutures, craniosynostosis
6FACEEyes (red reflex, ophthalmia neonatorum), Ears (low-set, OAE), Nose (choanal atresia), Mouth & Palate (cleft, Epstein pearls, tongue-tie)
7Neck, Clavicles & ChestTorticollis, cystic hygroma, clavicle fracture, breast nodule, witch's milk, PDA murmur
8AbdomenLiver/spleen normal limits, umbilical vessels (3 vs 1 artery), exomphalos vs gastroschisis, omphalitis
9Genitalia, Anus & SpineCryptorchidism, hypospadias, vaginal discharge (normal), imperforate anus, myelomeningocele, sacral dimple
10Limbs & HipsPolydactyly, talipes, Erb's / Klumpke's palsy, Ortolani & Barlow tests (DDH) in detail
11Skin — Normal Findings9 normal findings (erythema toxicum, Mongolian spot, milia, etc.) vs 6 pathological (port wine stain, herpes, impetigo)
12Primitive Reflexes Part 1Moro, Rooting, Sucking, Palmar Grasp — how to elicit, normal response, abnormal significance
13Primitive Reflexes Part 2ATNR (Fencer), Stepping, Galant, Plantar Grasp — same format
14Reflexes Part 3 + SummaryParachute, Babinski, Tonic Labyrinthine + full disappearance summary table
15KRAMER'S RULEAll 5 zones — body area, approximate bilirubin level (mg/dL + µmol/L), action required; limitations noted
16Normal Values — Quick ReferenceVital signs, anthropometry, skin, feeding/stools, genitalia, lab values
17Red Flags3-tier urgency — Emergency / Urgent / Early Referral (24 flags total)
18Key Pearls10 clinical pearls + References: Santhosh Kumar
This is a shared conversation. Sign in to Orris to start your own chat.