Make a pdf With complete anatomy for exam preparation in detail in easy words

Asking for Preferences

Which area of anatomy should the PDF cover? · What level is the exam?

I'll create a comprehensive anatomy PDF covering all major body systems, written in easy language for medical/health exam preparation. Let me first read the required skills and gather content simultaneously.
Reading File
Reading File
Now let me query the medical library for anatomy content across all major systems in parallel:
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Excellent! I have Gray's Anatomy for Students content. Let me read more from it to gather comprehensive system-by-system content:
Reading File
Finding Sources
I have rich content from Gray's Anatomy for Students. Now let me read more sections covering all major systems:
Finding Sources
Reading File
I have excellent anatomy content. Now let me generate the comprehensive PDF. Given the budget remaining, I'll create a detailed, well-structured PDF using my extensive medical knowledge plus the textbook content retrieved:
Running Command

mkdir -p /home/daytona/workspace/anatomy-pdf && ls /home/daytona/workspace/anatomy-pdf/

Writing File

~/anatomy-pdf/generate_anatomy_pdf.py

#!/usr/bin/env python3
"""
Complete Human Anatomy PDF for Exam Preparation
Generated using ReportLab
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.colors import (
    HexColor, white, black, Color
)
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.lib import colors

# ── Colour palette ──────────────────────────────────────────────────────────
DARK_BLUE   = HexColor('#1A3A5C')
MED_BLUE    = HexColor('#2E6DA4')
LIGHT_BLUE  = HexColor('#D6E8F7')
TEAL        = HexColor('#1B7A78')
LIGHT_TEAL  = HexColor('#D0EFEE')
ORANGE      = HexColor('#D4600A')
LIGHT_ORANGE= HexColor('#FCE8D8')
GREEN       = HexColor('#2D6A2D')
LIGHT_GREEN = HexColor('#D8EDDA')
PURPLE      = HexColor('#5A2D82')
LIGHT_PURPLE= HexColor('#EDE0F5')
GREY        = HexColor('#555555')
LIGHT_GREY  = HexColor('#F4F4F4')
CREAM       = HexColor('#FAFAF5')
RED         = HexColor('#C0392B')
LIGHT_RED   = HexColor('#FADBD8')

# ── Styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

TITLE_STYLE = S('Title',
    fontName='Helvetica-Bold', fontSize=32, textColor=white,
    alignment=TA_CENTER, spaceAfter=6, leading=38)

SUBTITLE_STYLE = S('Subtitle',
    fontName='Helvetica', fontSize=16, textColor=HexColor('#D6E8F7'),
    alignment=TA_CENTER, spaceAfter=4, leading=20)

H1 = S('H1',
    fontName='Helvetica-Bold', fontSize=18, textColor=white,
    spaceBefore=2, spaceAfter=4, leading=22,
    backColor=DARK_BLUE, leftIndent=-12, rightIndent=-12,
    borderPadding=(8, 12, 8, 12))

H2 = S('H2',
    fontName='Helvetica-Bold', fontSize=14, textColor=DARK_BLUE,
    spaceBefore=10, spaceAfter=4, leading=18,
    borderColor=MED_BLUE, borderWidth=0, leftIndent=0)

H3 = S('H3',
    fontName='Helvetica-Bold', fontSize=12, textColor=TEAL,
    spaceBefore=8, spaceAfter=3, leading=16)

BODY = S('Body',
    fontName='Helvetica', fontSize=10, textColor=HexColor('#222222'),
    spaceAfter=5, leading=15, alignment=TA_JUSTIFY)

BULLET = S('Bullet',
    fontName='Helvetica', fontSize=10, textColor=HexColor('#222222'),
    spaceAfter=3, leading=14, leftIndent=16,
    firstLineIndent=0, bulletIndent=4)

KEY_FACT = S('KeyFact',
    fontName='Helvetica-Bold', fontSize=10, textColor=DARK_BLUE,
    spaceAfter=4, leading=14, leftIndent=8)

MNEMONIC = S('Mnemonic',
    fontName='Helvetica-BoldOblique', fontSize=10.5, textColor=ORANGE,
    spaceAfter=4, leading=14, leftIndent=8)

CAPTION = S('Caption',
    fontName='Helvetica-Oblique', fontSize=8.5, textColor=GREY,
    alignment=TA_CENTER, spaceAfter=3)

TOC_ENTRY = S('TOC',
    fontName='Helvetica', fontSize=11, textColor=DARK_BLUE,
    spaceAfter=4, leading=16, leftIndent=0)

TOC_SUB = S('TOCSub',
    fontName='Helvetica', fontSize=10, textColor=GREY,
    spaceAfter=2, leading=14, leftIndent=18)

SMALL_HEAD = S('SmallHead',
    fontName='Helvetica-Bold', fontSize=10, textColor=PURPLE,
    spaceAfter=3, leading=14, leftIndent=0)

def b(text): return f'<b>{text}</b>'
def i(text): return f'<i>{text}</i>'
def bi(text): return f'<b><i>{text}</i></b>'
def bullet(text): return Paragraph(f'• {text}', BULLET)
def key(text): return Paragraph(f'🔑 {text}', KEY_FACT)
def mnemonic(text): return Paragraph(f'💡 Mnemonic: {text}', MNEMONIC)
def spacer(h=0.3): return Spacer(1, h*cm)
def hr(): return HRFlowable(width='100%', thickness=0.5, color=MED_BLUE, spaceAfter=6)

# ── Box helpers ───────────────────────────────────────────────────────────────
def info_box(title, items, bg=LIGHT_BLUE, header_bg=MED_BLUE):
    """Creates a styled info box with title and bullet points."""
    data = []
    data.append([Paragraph(f'<b>{title}</b>',
        S('BH', fontName='Helvetica-Bold', fontSize=10.5, textColor=white, leading=14))])
    for item in items:
        data.append([Paragraph(f'• {item}',
            S('BI', fontName='Helvetica', fontSize=9.5, textColor=HexColor('#1A1A1A'), leading=13, leftIndent=6))])
    t = Table(data, colWidths=['100%'])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (0,0), header_bg),
        ('BACKGROUND', (0,1), (-1,-1), bg),
        ('BOX', (0,0), (-1,-1), 1, header_bg),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 10),
        ('RIGHTPADDING', (0,0), (-1,-1), 8),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [bg, HexColor('#FAFEFF')]),
    ]))
    return t

def two_col_table(rows, col1_header='Structure', col2_header='Description',
                  bg1=LIGHT_BLUE, bg2=LIGHT_TEAL):
    header = [
        Paragraph(f'<b>{col1_header}</b>',
            S('TH', fontName='Helvetica-Bold', fontSize=10, textColor=white, leading=14)),
        Paragraph(f'<b>{col2_header}</b>',
            S('TH', fontName='Helvetica-Bold', fontSize=10, textColor=white, leading=14)),
    ]
    data = [header]
    for r in rows:
        data.append([
            Paragraph(b(r[0]), S('TC1', fontName='Helvetica-Bold', fontSize=9.5,
                                 textColor=DARK_BLUE, leading=13)),
            Paragraph(r[1], S('TC2', fontName='Helvetica', fontSize=9.5,
                               textColor=HexColor('#222'), leading=13)),
        ])
    t = Table(data, colWidths=[5.5*cm, 11*cm])
    style = [
        ('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
        ('BOX', (0,0), (-1,-1), 0.8, MED_BLUE),
        ('INNERGRID', (0,0), (-1,-1), 0.3, HexColor('#AACCEE')),
        ('VALIGN', (0,0), (-1,-1), 'TOP'),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 8),
        ('RIGHTPADDING', (0,0), (-1,-1), 8),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), [bg1, bg2]),
    ]
    t.setStyle(TableStyle(style))
    return t

def three_col_table(rows, headers, bgs=(LIGHT_BLUE, LIGHT_TEAL, LIGHT_GREEN)):
    header_row = [Paragraph(f'<b>{h}</b>',
        S('TH3', fontName='Helvetica-Bold', fontSize=9.5, textColor=white, leading=13))
        for h in headers]
    data = [header_row]
    for r in rows:
        data.append([Paragraph(str(c), S('TC3', fontName='Helvetica', fontSize=9,
            textColor=HexColor('#222'), leading=13)) for c in r])
    t = Table(data, colWidths=[5*cm, 5.5*cm, 6*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
        ('BOX', (0,0), (-1,-1), 0.8, MED_BLUE),
        ('INNERGRID', (0,0), (-1,-1), 0.3, HexColor('#AACCEE')),
        ('VALIGN', (0,0), (-1,-1), 'TOP'),
        ('TOPPADDING', (0,0), (-1,-1), 5),
        ('BOTTOMPADDING', (0,0), (-1,-1), 5),
        ('LEFTPADDING', (0,0), (-1,-1), 8),
        ('RIGHTPADDING', (0,0), (-1,-1), 8),
        ('ROWBACKGROUNDS', (0,1), (-1,-1), bgs[:2]),
    ]))
    return t

def section_header(title, subtitle='', color=DARK_BLUE, system_num=''):
    """Full-width section divider."""
    items = [[Paragraph(
        f'<font color="white"><b>{system_num}  {title}</b></font>',
        S('SHT', fontName='Helvetica-Bold', fontSize=16, textColor=white, leading=20, alignment=TA_LEFT))]]
    if subtitle:
        items[0].append(Paragraph(
            f'<font color="#D6E8F7">{subtitle}</font>',
            S('SHS', fontName='Helvetica', fontSize=10, textColor=LIGHT_BLUE, leading=14)))
    t = Table(items, colWidths=['100%'])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), color),
        ('TOPPADDING', (0,0), (-1,-1), 10),
        ('BOTTOMPADDING', (0,0), (-1,-1), 10),
        ('LEFTPADDING', (0,0), (-1,-1), 14),
        ('RIGHTPADDING', (0,0), (-1,-1), 14),
    ]))
    return t

# ── Page templates ────────────────────────────────────────────────────────────
def on_first_page(canvas, doc):
    """Cover page background."""
    canvas.saveState()
    w, h = A4
    canvas.setFillColor(DARK_BLUE)
    canvas.rect(0, 0, w, h, fill=1, stroke=0)
    # Decorative gradient band
    canvas.setFillColor(MED_BLUE)
    canvas.rect(0, h*0.38, w, h*0.31, fill=1, stroke=0)
    canvas.setFillColor(TEAL)
    canvas.rect(0, h*0.35, w, 4, fill=1, stroke=0)
    canvas.setFillColor(ORANGE)
    canvas.rect(0, h*0.38+h*0.31, w, 4, fill=1, stroke=0)
    canvas.restoreState()

def on_later_pages(canvas, doc):
    """Header/footer for content pages."""
    canvas.saveState()
    w, h = A4
    # Header bar
    canvas.setFillColor(DARK_BLUE)
    canvas.rect(0, h - 1.2*cm, w, 1.2*cm, fill=1, stroke=0)
    canvas.setFillColor(white)
    canvas.setFont('Helvetica-Bold', 9)
    canvas.drawString(1.5*cm, h - 0.85*cm, 'COMPLETE HUMAN ANATOMY — EXAM PREPARATION GUIDE')
    canvas.setFont('Helvetica', 9)
    canvas.drawRightString(w - 1.5*cm, h - 0.85*cm, f'Page {doc.page}')
    # Footer bar
    canvas.setFillColor(LIGHT_GREY)
    canvas.rect(0, 0, w, 0.9*cm, fill=1, stroke=0)
    canvas.setFillColor(GREY)
    canvas.setFont('Helvetica-Oblique', 7.5)
    canvas.drawString(1.5*cm, 0.35*cm, 'Based on Gray\'s Anatomy for Students & standard medical curricula')
    canvas.drawRightString(w - 1.5*cm, 0.35*cm, '© 2026 — For Educational Use Only')
    canvas.restoreState()

# ══════════════════════════════════════════════════════════════════════════════
#  CONTENT
# ══════════════════════════════════════════════════════════════════════════════
def build_story():
    story = []

    # ── COVER ─────────────────────────────────────────────────────────────────
    story += [
        spacer(4.5),
        Paragraph('COMPLETE HUMAN', TITLE_STYLE),
        Paragraph('ANATOMY', ParagraphStyle('T2', fontName='Helvetica-Bold', fontSize=48,
            textColor=ORANGE, alignment=TA_CENTER, leading=54, spaceAfter=6)),
        Paragraph('EXAM PREPARATION GUIDE', SUBTITLE_STYLE),
        spacer(0.4),
        Paragraph('All Body Systems • Easy Language • Exam-Ready Tables & Mnemonics',
            ParagraphStyle('CV', fontName='Helvetica', fontSize=12,
                textColor=HexColor('#B0D0EF'), alignment=TA_CENTER, leading=18)),
        spacer(0.5),
        Paragraph('Based on Gray\'s Anatomy for Students &amp; Standard Medical Curricula',
            ParagraphStyle('CVS', fontName='Helvetica-Oblique', fontSize=10,
                textColor=HexColor('#8BB8DE'), alignment=TA_CENTER, leading=16)),
        spacer(3.5),
        Paragraph('Covers: Skeletal • Muscular • Cardiovascular • Respiratory',
            ParagraphStyle('Cov', fontName='Helvetica', fontSize=11,
                textColor=LIGHT_BLUE, alignment=TA_CENTER, leading=17)),
        Paragraph('Nervous • Digestive • Urinary • Reproductive • Endocrine • Lymphatic',
            ParagraphStyle('Cov2', fontName='Helvetica', fontSize=11,
                textColor=LIGHT_BLUE, alignment=TA_CENTER, leading=17)),
        PageBreak(),
    ]

    # ── TABLE OF CONTENTS ─────────────────────────────────────────────────────
    story += [
        spacer(0.5),
        Paragraph('TABLE OF CONTENTS', H1),
        spacer(0.4),
    ]
    toc_entries = [
        ('1', 'Introduction to Anatomy', 'Planes, Terms, Imaging'),
        ('2', 'Skeletal System', 'Bones, Joints, Cartilage'),
        ('3', 'Muscular System', 'Muscle Types, Actions, Key Muscles'),
        ('4', 'Cardiovascular System', 'Heart, Blood Vessels, Circulation'),
        ('5', 'Respiratory System', 'Airway, Lungs, Mechanics'),
        ('6', 'Nervous System', 'CNS, PNS, ANS, Cranial Nerves'),
        ('7', 'Digestive System', 'GI Tract, Accessory Organs'),
        ('8', 'Urinary System', 'Kidneys, Ureters, Bladder'),
        ('9', 'Reproductive System', 'Male & Female Anatomy'),
        ('10', 'Endocrine System', 'Glands & Hormones'),
        ('11', 'Lymphatic & Immune System', 'Lymph Nodes, Spleen, Thymus'),
        ('12', 'Head & Neck', 'Skull, Cranial Nerves, Throat'),
        ('13', 'Upper Limb', 'Shoulder, Arm, Forearm, Hand'),
        ('14', 'Lower Limb', 'Hip, Thigh, Leg, Foot'),
        ('15', 'Back & Spine', 'Vertebrae, Spinal Cord, Muscles'),
        ('16', 'Quick Revision Tables', 'High-Yield Facts for Exams'),
    ]
    for num, title, sub in toc_entries:
        story.append(Paragraph(
            f'<b><font color="#1A3A5C">{num}.</font></b>  <font color="#2E6DA4"><b>{title}</b></font>'
            f'  <font color="#888888"><i>— {sub}</i></font>', TOC_ENTRY))
        story.append(Spacer(1, 2))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 1 — INTRODUCTION TO ANATOMY
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('INTRODUCTION TO ANATOMY',
        'Planes, Positions, Directional Terms & Imaging', DARK_BLUE, '01'))
    story.append(spacer(0.3))

    story.append(Paragraph('What is Anatomy?', H2))
    story.append(Paragraph(
        'Anatomy is the study of the structure of the human body. The word comes from the Greek '
        '<i>temnein</i> meaning "to cut." It forms the foundation of all medical practice. '
        'There are two main types:', BODY))
    story.append(bullet('<b>Gross (Macroscopic) Anatomy</b> — structures visible to the naked eye'))
    story.append(bullet('<b>Microscopic Anatomy (Histology)</b> — study of cells and tissues under a microscope'))
    story.append(bullet('<b>Regional Anatomy</b> — all structures in a body region studied together'))
    story.append(bullet('<b>Systemic Anatomy</b> — one body system studied throughout the whole body'))
    story.append(spacer(0.2))

    story.append(Paragraph('The Anatomical Position', H2))
    story.append(Paragraph(
        'All anatomical descriptions use the <b>anatomical position</b> as the standard reference:', BODY))
    story.append(bullet('Body standing upright'))
    story.append(bullet('Feet together, toes pointing forward'))
    story.append(bullet('Arms at sides with palms facing forward'))
    story.append(bullet('Head upright, eyes looking forward, mouth closed'))
    story.append(spacer(0.2))

    story.append(Paragraph('Body Planes', H2))
    planes_rows = [
        ('Sagittal Plane', 'Divides body into LEFT and RIGHT. Midsagittal = exactly down the middle.'),
        ('Coronal (Frontal) Plane', 'Divides body into FRONT (anterior) and BACK (posterior).'),
        ('Transverse (Axial) Plane', 'Horizontal cut dividing body into UPPER (superior) and LOWER (inferior).'),
        ('Oblique Plane', 'Any cut at an angle — not parallel to the above three planes.'),
    ]
    story.append(two_col_table(planes_rows, 'Plane', 'Description', LIGHT_BLUE, CREAM))
    story.append(spacer(0.3))

    story.append(Paragraph('Directional Terms', H2))
    dir_rows = [
        ('Superior / Inferior', 'Above / Below'),
        ('Anterior (Ventral) / Posterior (Dorsal)', 'Front / Back'),
        ('Medial / Lateral', 'Toward midline / Away from midline'),
        ('Proximal / Distal', 'Closer to trunk / Farther from trunk'),
        ('Superficial / Deep', 'Toward surface / Away from surface'),
        ('Ipsilateral / Contralateral', 'Same side / Opposite side'),
    ]
    story.append(two_col_table(dir_rows, 'Term', 'Meaning', LIGHT_TEAL, CREAM))
    story.append(spacer(0.3))

    story.append(Paragraph('Body Imaging — Quick Overview', H2))
    imaging_rows = [
        ('X-Ray (Plain Film)', 'Uses radiation; bones appear WHITE (radiopaque); air = black. Best for fractures.'),
        ('CT Scan', 'Multiple X-ray slices. Excellent for bone + organs. "Hounsfield units" measure density.'),
        ('MRI', 'Uses magnetic fields + radio waves. T1: fat bright, fluid dark. T2: fluid bright. Best for soft tissue.'),
        ('Ultrasound', 'Sound waves. Safe in pregnancy. Real-time imaging. Fluid = dark (anechoic).'),
        ('Nuclear Medicine (PET/SPECT)', 'Radioactive tracers show metabolic activity. Used in cancer staging.'),
    ]
    story.append(two_col_table(imaging_rows, 'Modality', 'Key Facts', LIGHT_BLUE, CREAM))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 2 — SKELETAL SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('SKELETAL SYSTEM',
        'Bones, Joints, Cartilage & Clinical Relevance', MED_BLUE, '02'))
    story.append(spacer(0.3))

    story.append(Paragraph('Overview', H2))
    story.append(Paragraph(
        'The adult skeleton has <b>206 bones</b>. The skeleton is divided into two parts:', BODY))
    story.append(info_box('Axial Skeleton (80 bones)',
        ['Skull (cranium + mandible) — 22 bones',
         'Vertebral column — 26 bones (7 cervical, 12 thoracic, 5 lumbar, 1 sacrum, 1 coccyx)',
         'Thoracic cage — 25 bones (12 pairs of ribs + sternum)',
         'Hyoid bone — 1'], LIGHT_BLUE, MED_BLUE))
    story.append(spacer(0.2))
    story.append(info_box('Appendicular Skeleton (126 bones)',
        ['Upper limbs — 64 bones (clavicle, scapula, humerus, radius, ulna, wrist, hand)',
         'Lower limbs — 62 bones (hip bones, femur, patella, tibia, fibula, ankle, foot)',
         'Pelvic girdle — part of lower limb count'], LIGHT_GREEN, GREEN))
    story.append(spacer(0.3))

    story.append(Paragraph('Functions of the Skeleton', H2))
    story.append(bullet('<b>Support</b> — provides framework for the body'))
    story.append(bullet('<b>Protection</b> — skull protects brain; ribs protect heart and lungs'))
    story.append(bullet('<b>Movement</b> — acts as levers for muscle action'))
    story.append(bullet('<b>Mineral storage</b> — calcium and phosphorus reservoir'))
    story.append(bullet('<b>Blood cell production</b> — red bone marrow produces RBCs, WBCs, platelets'))

    story.append(spacer(0.2))
    story.append(Paragraph('Types of Bone', H2))
    bone_rows = [
        ('Long Bones', 'Tubular shape. E.g., humerus, femur, tibia, radius.'),
        ('Short Bones', 'Cuboidal shape. E.g., carpals (wrist), tarsals (ankle).'),
        ('Flat Bones', 'Two compact layers + spongy bone between. E.g., skull, sternum, scapula.'),
        ('Irregular Bones', 'Complex shape. E.g., vertebrae, facial bones, hip bone.'),
        ('Sesamoid Bones', 'Develop inside tendons. E.g., patella (kneecap). Protect tendons from stress.'),
    ]
    story.append(two_col_table(bone_rows, 'Bone Type', 'Features & Examples', LIGHT_BLUE, CREAM))

    story.append(spacer(0.3))
    story.append(Paragraph('Bone Structure', H2))
    story.append(Paragraph(
        'A typical long bone has the following parts:', BODY))
    bone_struct = [
        ('Diaphysis', 'The shaft — hollow cylindrical compact bone surrounding medullary cavity.'),
        ('Epiphysis', 'The expanded ends — mainly spongy (cancellous) bone, covered by articular cartilage.'),
        ('Metaphysis', 'Transition zone between diaphysis and epiphysis. Contains growth plate in children.'),
        ('Periosteum', 'Fibrous membrane covering outer bone surface. Rich in vessels and nerves. Needed for bone repair.'),
        ('Endosteum', 'Thin membrane lining the medullary cavity.'),
        ('Articular Cartilage', 'Hyaline cartilage covering joint surfaces — reduces friction.'),
        ('Medullary Cavity', 'Central cavity containing yellow marrow (fat) in adults.'),
        ('Red Bone Marrow', 'Found in spongy bone of flat bones + epiphyses. Produces blood cells.'),
    ]
    story.append(two_col_table(bone_struct, 'Structure', 'Description', LIGHT_TEAL, CREAM))

    story.append(spacer(0.3))
    story.append(Paragraph('Types of Joints (Articulations)', H2))
    joint_rows = [
        ('Fibrous (Synarthrosis)', 'Bones connected by fibrous tissue. Little/no movement. E.g., skull sutures, gomphosis (teeth).'),
        ('Cartilaginous (Amphiarthrosis)', 'Bones joined by cartilage. Slight movement. E.g., pubic symphysis, intervertebral discs.'),
        ('Synovial (Diarthrosis)', 'Free-moving joints with synovial cavity. Most joints in the body are synovial.'),
    ]
    story.append(two_col_table(joint_rows, 'Joint Type', 'Features & Examples', LIGHT_BLUE, LIGHT_TEAL))

    story.append(spacer(0.2))
    story.append(Paragraph('Types of Synovial Joints', H3))
    syn_rows = [
        ('Ball & Socket', 'Hip, shoulder', 'Flexion, extension, abduction, adduction, rotation, circumduction'),
        ('Hinge', 'Elbow, knee, ankle', 'Flexion and extension only'),
        ('Pivot', 'Atlantoaxial (C1-C2), proximal radioulnar', 'Rotation'),
        ('Condyloid (Ellipsoid)', 'Wrist (radiocarpal), MCP joints', 'Flexion/extension + abduction/adduction'),
        ('Saddle', 'First carpometacarpal (thumb)', 'Flexion/extension + abduction/adduction'),
        ('Plane (Gliding)', 'Intercarpal, intertarsal joints', 'Gliding/sliding movements'),
    ]
    story.append(three_col_table(syn_rows,
        ['Joint Type', 'Example', 'Movements Allowed']))

    story.append(spacer(0.2))
    mnemonic_text = '"<b>B</b>obs <b>H</b>is <b>P</b>ile <b>C</b>ompletely <b>S</b>till <b>P</b>lease" = Ball-socket, Hinge, Pivot, Condyloid, Saddle, Plane'
    story.append(mnemonic(mnemonic_text))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 3 — MUSCULAR SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('MUSCULAR SYSTEM',
        'Muscle Types, Key Muscles & Clinical Notes', TEAL, '03'))
    story.append(spacer(0.3))

    story.append(Paragraph('Three Types of Muscle', H2))
    muscle_rows = [
        ('Skeletal Muscle', 'Voluntary — we control it. Striated appearance. Attached to bones via tendons. '
            'Multinucleated, nuclei at periphery. Fatigues quickly.'),
        ('Smooth Muscle', 'Involuntary — not consciously controlled. Found in walls of hollow organs (gut, bladder, '
            'blood vessels). Spindle-shaped cells, single central nucleus. Slow, sustained contractions.'),
        ('Cardiac Muscle', 'Involuntary, striated. Found only in the heart. Intercalated discs connect cells. '
            'Single/double nucleus. Never fatigues under normal conditions.'),
    ]
    story.append(two_col_table(muscle_rows, 'Muscle Type', 'Key Features', LIGHT_BLUE, LIGHT_TEAL))

    story.append(spacer(0.3))
    story.append(Paragraph('Muscle Terminology', H2))
    term_rows = [
        ('Origin', 'The fixed, less-movable attachment of a muscle (usually proximal).'),
        ('Insertion', 'The movable attachment of a muscle (usually distal).'),
        ('Agonist (Prime Mover)', 'Main muscle causing a movement. E.g., biceps brachii for elbow flexion.'),
        ('Antagonist', 'Muscle opposing the agonist. Relaxes while agonist contracts. E.g., triceps vs. biceps.'),
        ('Synergist', 'Assists the agonist. Also stabilises joints. E.g., brachialis assists biceps.'),
        ('Fixator', 'Stabilises the origin so the agonist can work efficiently.'),
    ]
    story.append(two_col_table(term_rows, 'Term', 'Meaning', LIGHT_TEAL, CREAM))

    story.append(spacer(0.3))
    story.append(Paragraph('Key Muscles to Know', H2))

    story.append(Paragraph('Upper Limb', H3))
    upper_muscles = [
        ('Deltoid', 'Abducts arm at shoulder (middle fibres). Ant. fibres = flexion; Post. fibres = extension.'),
        ('Biceps Brachii', 'Flexes elbow + supinates forearm. Two heads (long + short). Origin: scapula.'),
        ('Triceps Brachii', 'Extends elbow. Three heads. Main extensor of the forearm. Supplied by radial nerve.'),
        ('Brachioradialis', 'Flexes forearm at elbow. Acts best in mid-prone position.'),
        ('Flexor Carpi Radialis', 'Flexes + abducts the wrist.'),
        ('Extensor Carpi Ulnaris', 'Extends + adducts the wrist.'),
    ]
    story.append(two_col_table(upper_muscles, 'Muscle', 'Action & Notes', LIGHT_BLUE, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Lower Limb', H3))
    lower_muscles = [
        ('Iliopsoas', 'Flexes the hip. Most powerful hip flexor. Iliacus + Psoas major.'),
        ('Gluteus Maximus', 'Extends and externally rotates the hip. Most powerful extensor. Supplied by inferior gluteal nerve.'),
        ('Quadriceps Femoris', '4 muscles: Rectus femoris, Vastus lateralis, medialis, intermedius. Extends knee.'),
        ('Hamstrings', 'Biceps femoris, semimembranosus, semitendinosus. Flex knee + extend hip.'),
        ('Gastrocnemius', 'Plantar flexes the foot. Two heads from femoral condyles. Calf muscle.'),
        ('Tibialis Anterior', 'Dorsiflexes and inverts the foot. "Shin muscle."'),
    ]
    story.append(two_col_table(lower_muscles, 'Muscle', 'Action & Notes', LIGHT_TEAL, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Muscles of Respiration', H3))
    resp_muscles = [
        ('Diaphragm', 'Primary muscle of breathing. Dome-shaped. Contracts → flattens → lung volume increases → inhalation.'),
        ('External Intercostals', 'Elevate ribs during inhalation. Run obliquely downward and forward.'),
        ('Internal Intercostals', 'Depress ribs during forced exhalation. Run obliquely downward and backward.'),
        ('Scalenes (Ant., Mid., Post.)', 'Accessory muscles — elevate first two ribs during deep/forced breathing.'),
        ('Sternocleidomastoid', 'Accessory muscle — elevates sternum during forced inhalation.'),
    ]
    story.append(two_col_table(resp_muscles, 'Muscle', 'Role', LIGHT_BLUE, CREAM))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 4 — CARDIOVASCULAR SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('CARDIOVASCULAR SYSTEM',
        'Heart, Blood Vessels & Circulation', RED, '04'))
    story.append(spacer(0.3))

    story.append(Paragraph('The Heart', H2))
    story.append(Paragraph(
        'The heart is a <b>muscular pump</b> about the size of a fist, located in the <b>mediastinum</b> '
        '(middle of the chest), slightly left of midline. It has four chambers and beats approximately '
        '<b>60–100 times per minute</b> at rest.', BODY))

    story.append(info_box('Four Chambers of the Heart',
        ['Right Atrium — receives deoxygenated blood from the body via Superior + Inferior Vena Cava',
         'Right Ventricle — pumps deoxygenated blood to lungs via Pulmonary Trunk',
         'Left Atrium — receives oxygenated blood from lungs via 4 Pulmonary Veins',
         'Left Ventricle — pumps oxygenated blood to body via Aorta. Has thickest wall.'],
        LIGHT_RED, RED))

    story.append(spacer(0.2))
    story.append(Paragraph('Heart Valves', H2))
    valve_rows = [
        ('Tricuspid Valve', 'Right AV valve. Between right atrium and right ventricle. 3 cusps.'),
        ('Pulmonary (Semilunar) Valve', 'Between right ventricle and pulmonary trunk. 3 cusps. Prevents backflow.'),
        ('Mitral (Bicuspid) Valve', 'Left AV valve. Between left atrium and left ventricle. 2 cusps.'),
        ('Aortic (Semilunar) Valve', 'Between left ventricle and aorta. 3 cusps. Prevents backflow into LV.'),
    ]
    story.append(two_col_table(valve_rows, 'Valve', 'Location & Features', LIGHT_RED, CREAM))

    story.append(spacer(0.2))
    story.append(mnemonic('"<b>T</b>ry <b>P</b>ulling <b>M</b>y <b>A</b>orta" = Tricuspid, Pulmonary, Mitral, Aortic — right to left order'))

    story.append(spacer(0.2))
    story.append(Paragraph('Blood Circulation', H2))
    story.append(Paragraph(
        'There are two circuits of blood flow:', BODY))
    story.append(bullet('<b>Pulmonary Circulation</b> — Right ventricle → Pulmonary arteries → Lungs (gas exchange) → '
        'Pulmonary veins → Left atrium. <i>(Deoxygenated blood goes to lungs, returns oxygenated)</i>'))
    story.append(bullet('<b>Systemic Circulation</b> — Left ventricle → Aorta → Body organs → '
        'Superior/Inferior Vena Cava → Right atrium. <i>(Oxygenated blood goes to body)</i>'))
    story.append(spacer(0.1))
    story.append(key('REMEMBER: Pulmonary ARTERIES carry DEOXYGENATED blood — opposite to the usual rule!'))

    story.append(spacer(0.2))
    story.append(Paragraph('Blood Vessels', H2))
    vessel_rows = [
        ('Large Elastic Arteries', 'Aorta, pulmonary trunk, carotid arteries. Lots of elastic fibers → stretch during systole.'),
        ('Medium Muscular Arteries', 'Most named arteries (femoral, radial, etc.). Control blood flow via smooth muscle contraction.'),
        ('Arterioles', 'Smallest arteries before capillaries. Major regulators of blood pressure.'),
        ('Capillaries', 'Smallest vessels — one cell thick. Site of O₂, CO₂, nutrient and waste exchange.'),
        ('Venules', 'Collect blood from capillaries.'),
        ('Veins', 'Return blood to heart. Thin walls, larger lumen than arteries. Have valves to prevent backflow.'),
    ]
    story.append(two_col_table(vessel_rows, 'Vessel Type', 'Features', LIGHT_RED, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Cardiac Conduction System', H2))
    story.append(Paragraph(
        'This system generates and conducts electrical impulses that coordinate the heartbeat:', BODY))
    conduction_rows = [
        ('SA Node (Sinoatrial)', 'In right atrium wall near SVC. The natural pacemaker. Rate: 60–100/min.'),
        ('AV Node (Atrioventricular)', 'At border of atria and ventricles. Delays impulse 0.1 sec (allows atria to empty first).'),
        ('Bundle of His', 'In the interventricular septum. Carries impulse from AV node downward.'),
        ('Left & Right Bundle Branches', 'Divide and run down each side of interventricular septum.'),
        ('Purkinje Fibers', 'Spread throughout ventricular myocardium. Cause ventricular contraction.'),
    ]
    story.append(two_col_table(conduction_rows, 'Structure', 'Role', LIGHT_RED, LIGHT_ORANGE))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 5 — RESPIRATORY SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('RESPIRATORY SYSTEM',
        'Airways, Lungs & Mechanics of Breathing', TEAL, '05'))
    story.append(spacer(0.3))

    story.append(Paragraph('Overview', H2))
    story.append(Paragraph(
        'The respiratory system brings oxygen into the body and removes carbon dioxide. '
        'It is divided into the <b>upper respiratory tract</b> (nose to larynx) and the '
        '<b>lower respiratory tract</b> (trachea to alveoli).', BODY))

    story.append(Paragraph('Conducting Zone — The Airway', H2))
    airway_rows = [
        ('Nose / Nasal Cavity', 'Warms, filters, and humidifies inhaled air. Contains olfactory epithelium.'),
        ('Pharynx', 'Shared passage for air and food. Three parts: nasopharynx, oropharynx, laryngopharynx.'),
        ('Larynx', 'Voice box. Contains vocal cords. Epiglottis prevents food entering airway. Adam\'s apple = thyroid cartilage.'),
        ('Trachea', '~12 cm long. C-shaped cartilage rings keep it open. Lined with ciliated epithelium.'),
        ('Primary Bronchi', 'Trachea splits at carina (T4-T5 level) into left and right primary bronchi.'),
        ('Secondary Bronchi', 'One per lobe (3 right, 2 left).'),
        ('Tertiary Bronchi', 'One per bronchopulmonary segment (10 right, 8-10 left).'),
        ('Bronchioles', 'No cartilage. Terminal bronchioles = last part of conducting zone.'),
        ('Respiratory Bronchioles', 'First part of respiratory zone. Begin gas exchange.'),
        ('Alveolar Ducts & Alveoli', 'Main gas exchange site. ~300 million alveoli. Huge surface area (~70 m²).'),
    ]
    story.append(two_col_table(airway_rows, 'Structure', 'Key Facts', LIGHT_TEAL, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('The Lungs', H2))
    story.append(Paragraph(
        'The lungs are spongy, cone-shaped organs in the thoracic cavity, separated by the <b>mediastinum</b>. '
        'Each lung is covered by the <b>pleura</b> (visceral pleura on lung surface, parietal pleura on chest wall).', BODY))
    story.append(info_box('Right Lung vs. Left Lung',
        ['Right Lung: 3 lobes (upper, middle, lower) — larger, heavier',
         'Left Lung: 2 lobes (upper, lower) — smaller (heart takes up space on left)',
         'Left lung has a cardiac notch to accommodate the heart',
         'Hilum = where bronchi, vessels, and nerves enter/exit each lung'],
        LIGHT_TEAL, TEAL))

    story.append(spacer(0.2))
    story.append(Paragraph('Mechanics of Breathing', H2))
    story.append(Paragraph('<b>Inhalation (active process):</b>', BODY))
    story.append(bullet('Diaphragm contracts and moves down'))
    story.append(bullet('External intercostal muscles raise the rib cage'))
    story.append(bullet('Thoracic volume increases → pressure decreases → air flows in'))
    story.append(Paragraph('<b>Exhalation (passive at rest):</b>', BODY))
    story.append(bullet('Diaphragm and intercostals relax'))
    story.append(bullet('Thoracic volume decreases → pressure increases → air flows out'))
    story.append(bullet('Forced exhalation uses internal intercostals + abdominal muscles'))

    story.append(spacer(0.2))
    story.append(Paragraph('Lung Volumes & Capacities', H2))
    lung_vol_rows = [
        ('Tidal Volume (TV)', '~500 mL', 'Air moved in/out with each normal breath'),
        ('Inspiratory Reserve Volume (IRV)', '~3000 mL', 'Extra air that can be inhaled after normal breath'),
        ('Expiratory Reserve Volume (ERV)', '~1200 mL', 'Extra air that can be exhaled after normal breath'),
        ('Residual Volume (RV)', '~1200 mL', 'Air remaining after maximum exhalation — never leaves lungs'),
        ('Vital Capacity (VC)', '~4700 mL', 'TV + IRV + ERV — maximum amount you can breathe in or out'),
        ('Total Lung Capacity (TLC)', '~6000 mL', 'VC + RV — total air the lungs can hold'),
    ]
    story.append(three_col_table(lung_vol_rows, ['Volume', 'Average Value', 'Definition']))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 6 — NERVOUS SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('NERVOUS SYSTEM',
        'CNS, PNS, ANS & Cranial Nerves', PURPLE, '06'))
    story.append(spacer(0.3))

    story.append(Paragraph('Overview', H2))
    story.append(Paragraph(
        'The nervous system is the body\'s control and communication network. It processes information '
        'and coordinates responses. It is divided into:', BODY))
    story.append(bullet('<b>Central Nervous System (CNS)</b> — Brain + Spinal cord'))
    story.append(bullet('<b>Peripheral Nervous System (PNS)</b> — All nerves outside the CNS'))
    story.append(bullet('<b>Somatic NS</b> (voluntary) — controls skeletal muscles, carries sensory input'))
    story.append(bullet('<b>Autonomic NS</b> (involuntary) — controls visceral organs; divided into sympathetic & parasympathetic'))

    story.append(spacer(0.2))
    story.append(Paragraph('The Brain', H2))
    brain_rows = [
        ('Cerebrum', 'Largest part. Two hemispheres (left + right). Controls thought, memory, language, sensation, voluntary movement.'),
        ('Frontal Lobe', 'Voluntary motor control (motor cortex), speech (Broca\'s area), personality, planning.'),
        ('Parietal Lobe', 'Sensory information processing (somatosensory cortex), spatial awareness.'),
        ('Temporal Lobe', 'Hearing, language understanding (Wernicke\'s area), memory (hippocampus).'),
        ('Occipital Lobe', 'Vision processing. Primary visual cortex.'),
        ('Cerebellum', 'Coordinates balance and fine motor movements. "Little brain." Located posteriorly.'),
        ('Brainstem', 'Midbrain + Pons + Medulla oblongata. Controls vital functions: breathing, heart rate, blood pressure, reflexes.'),
        ('Thalamus', 'Relay station — routes sensory signals to correct cortical area.'),
        ('Hypothalamus', 'Regulates autonomic functions, hunger, thirst, temperature, hormones (controls pituitary gland).'),
        ('Limbic System', 'Amygdala, hippocampus, cingulate gyrus. Emotions, memory, motivation.'),
    ]
    story.append(two_col_table(brain_rows, 'Structure', 'Function', LIGHT_PURPLE, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Meninges — Protective Layers of Brain/Spinal Cord', H2))
    story.append(Paragraph(
        'Three layers of connective tissue surround the brain and spinal cord (outside to inside):', BODY))
    story.append(bullet('<b>Dura Mater</b> — outermost, thickest, tough fibrous layer'))
    story.append(bullet('<b>Arachnoid Mater</b> — middle layer, web-like. Subarachnoid space contains CSF.'))
    story.append(bullet('<b>Pia Mater</b> — innermost, delicate, directly on brain surface'))
    story.append(mnemonic('"<b>D</b>ura <b>A</b>rachnoid <b>P</b>ia" = DAP — like a <b>DAP</b> (handshake) protecting the brain'))

    story.append(spacer(0.2))
    story.append(Paragraph('The 12 Cranial Nerves', H2))
    cn_rows = [
        ('I — Olfactory', 'Sensory', 'Smell'),
        ('II — Optic', 'Sensory', 'Vision'),
        ('III — Oculomotor', 'Motor + Parasympathetic', 'Eye movement (most), pupil constriction, lens shape'),
        ('IV — Trochlear', 'Motor', 'Superior oblique muscle (eye moves down + inward)'),
        ('V — Trigeminal', 'Sensory + Motor', 'Sensation of face; chewing muscles'),
        ('VI — Abducens', 'Motor', 'Lateral rectus muscle (eye abduction)'),
        ('VII — Facial', 'Motor + Sensory', 'Facial expression; taste (anterior 2/3 tongue); lacrimation/salivation'),
        ('VIII — Vestibulocochlear', 'Sensory', 'Hearing and balance'),
        ('IX — Glossopharyngeal', 'Sensory + Motor', 'Taste (posterior 1/3 tongue); swallowing; parotid gland'),
        ('X — Vagus', 'Sensory + Motor + Parasympathetic', 'Heart, lungs, most of GI tract; speaking, swallowing'),
        ('XI — Accessory', 'Motor', 'Sternocleidomastoid + Trapezius muscles'),
        ('XII — Hypoglossal', 'Motor', 'Tongue movements'),
    ]
    story.append(three_col_table(cn_rows, ['Nerve', 'Type', 'Function']))
    story.append(spacer(0.2))
    story.append(mnemonic('"<b>O</b>h <b>O</b>h <b>O</b>h <b>T</b>o <b>T</b>ouch <b>A</b>nd <b>F</b>eel <b>V</b>ery <b>G</b>ood <b>V</b>elvet, <b>A</b>hh <b>H</b>eaven" = I-XII Cranial Nerves'))

    story.append(spacer(0.2))
    story.append(Paragraph('Autonomic Nervous System', H2))
    auto_rows = [
        ('Sympathetic ("Fight or Flight")',
         'Increases heart rate, dilates pupils, inhibits digestion, increases BP, dilates bronchioles. Thoracolumbar outflow (T1-L2).'),
        ('Parasympathetic ("Rest and Digest")',
         'Decreases heart rate, constricts pupils, stimulates digestion, reduces BP, constricts bronchioles. Craniosacral outflow (CN III,VII,IX,X; S2-S4).'),
    ]
    story.append(two_col_table(auto_rows, 'Division', 'Effects', LIGHT_PURPLE, LIGHT_GREEN))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 7 — DIGESTIVE SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('DIGESTIVE SYSTEM',
        'GI Tract, Accessory Organs & Absorption', GREEN, '07'))
    story.append(spacer(0.3))

    story.append(Paragraph('The GI Tract — Alimentary Canal', H2))
    story.append(Paragraph(
        'The GI tract is approximately <b>9 metres long</b> and runs from mouth to anus. '
        'It breaks down food mechanically and chemically, absorbs nutrients, and eliminates waste.', BODY))

    gi_rows = [
        ('Mouth (Oral Cavity)', 'Mechanical digestion (chewing). Salivary amylase begins starch digestion.'),
        ('Pharynx', 'Passageway. Swallowing reflex initiated here.'),
        ('Oesophagus', '~25 cm. Peristalsis moves food to stomach. No digestion occurs here.'),
        ('Stomach', 'Muscular J-shaped organ. HCl + pepsinogen → protein digestion begins. Stores ~1.5 L food.'),
        ('Small Intestine', '~6 metres. Three parts: Duodenum → Jejunum → Ileum. Main site of digestion and ABSORPTION.'),
        ('Duodenum', '~25 cm (C-shaped). Receives bile from liver + pancreatic juice. Most digestion completed here.'),
        ('Jejunum', '~2.5 m. Main absorption of nutrients (villi + microvilli greatly increase surface area).'),
        ('Ileum', '~3.5 m. Absorbs vitamin B12, bile salts. Ends at ileocaecal valve.'),
        ('Large Intestine', '~1.5 m. Absorbs water + electrolytes. Produces faeces. Parts: caecum, colon, rectum, anal canal.'),
        ('Rectum & Anal Canal', 'Stores and eliminates faeces.'),
    ]
    story.append(two_col_table(gi_rows, 'Organ', 'Key Functions', LIGHT_GREEN, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Accessory Digestive Organs', H2))
    acc_rows = [
        ('Liver', 'Largest internal organ (~1.5 kg). Functions: bile production, detoxification, protein synthesis, '
            'glycogen storage, cholesterol metabolism. Dual blood supply: portal vein + hepatic artery.'),
        ('Gallbladder', 'Stores and concentrates bile. Located under right lobe of liver. '
            'Bile emulsifies fats in duodenum.'),
        ('Pancreas', 'Both exocrine (digestive enzymes) and endocrine (insulin, glucagon) functions. '
            'Exocrine: amylase, lipase, proteases. Endocrine: islets of Langerhans.'),
        ('Salivary Glands', 'Three pairs: Parotid, Submandibular, Sublingual. Produce saliva. '
            'Parotid is largest; duct opens near upper 2nd molar.'),
    ]
    story.append(two_col_table(acc_rows, 'Organ', 'Key Details', LIGHT_GREEN, LIGHT_TEAL))

    story.append(spacer(0.2))
    story.append(Paragraph('Peritoneum', H2))
    story.append(Paragraph(
        'The peritoneum is a serous membrane lining the abdominal cavity. It has two layers:', BODY))
    story.append(bullet('<b>Parietal peritoneum</b> — lines the abdominal wall'))
    story.append(bullet('<b>Visceral peritoneum</b> — covers the organs'))
    story.append(bullet('<b>Intraperitoneal organs</b> — stomach, small intestine, liver, gallbladder, spleen, sigmoid colon'))
    story.append(bullet('<b>Retroperitoneal organs</b> — kidneys, adrenal glands, pancreas (mostly), duodenum, ascending + descending colon'))
    story.append(mnemonic('"<b>S</b>AD <b>P</b>UCKeR" = Suprarenal (adrenal) glands, Aorta/IVC, Duodenum, Pancreas, Ureters, Colon (ascending + descending), Kidneys, Rectum — retroperitoneal structures'))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 8 — URINARY SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('URINARY SYSTEM',
        'Kidneys, Ureters, Bladder & Urethra', MED_BLUE, '08'))
    story.append(spacer(0.3))

    story.append(Paragraph('Overview', H2))
    story.append(Paragraph(
        'The urinary system filters blood, removes metabolic waste, and regulates fluid, electrolyte, '
        'and acid-base balance. It produces urine.', BODY))

    story.append(Paragraph('The Kidneys', H2))
    story.append(Paragraph(
        'The kidneys are paired, bean-shaped organs located <b>retroperitoneally</b> on the posterior '
        'abdominal wall at vertebral levels <b>T12–L3</b>. The right kidney is slightly lower than the left '
        '(due to the liver).', BODY))

    kidney_rows = [
        ('Renal Cortex', 'Outer region. Contains glomeruli + convoluted tubules. Site of filtration.'),
        ('Renal Medulla', 'Inner region. Contains renal pyramids and loops of Henle. Concentration of urine.'),
        ('Renal Pelvis', 'Funnel-shaped. Collects urine from major calyces → drains into ureter.'),
        ('Hilum', 'Indentation on medial border. Entry/exit point for renal artery, vein, ureter.'),
        ('Nephron', 'Functional unit of kidney. ~1 million per kidney. Glomerulus → tubules → collecting duct.'),
    ]
    story.append(two_col_table(kidney_rows, 'Structure', 'Description', LIGHT_BLUE, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('The Nephron — Urine Formation Steps', H2))
    story.append(bullet('<b>Filtration</b> — in glomerulus. Blood pressure pushes water + solutes into Bowman\'s capsule.'))
    story.append(bullet('<b>Reabsorption</b> — ~99% of filtrate reabsorbed in proximal tubule, loop of Henle, distal tubule.'))
    story.append(bullet('<b>Secretion</b> — extra wastes (H⁺, K⁺, drugs) secreted from blood into tubule.'))
    story.append(bullet('<b>Excretion</b> — remaining fluid = urine → collecting duct → renal pelvis → ureter → bladder.'))

    story.append(spacer(0.2))
    story.append(Paragraph('Ureters, Bladder & Urethra', H2))
    ub_rows = [
        ('Ureters', '~25–30 cm long. Muscular tubes. Peristalsis moves urine to bladder. '
            'Cross the pelvic brim at the bifurcation of common iliac arteries.'),
        ('Urinary Bladder', 'Muscular hollow organ. Stores up to 500 mL urine. '
            'Detrusor muscle contracts during micturition. Trigone = triangle between two ureteral openings + urethral outlet.'),
        ('Urethra (Male)', '~20 cm. Three parts: prostatic, membranous, spongy (penile). '
            'Has two sphincters: internal (involuntary) + external (voluntary).'),
        ('Urethra (Female)', '~4 cm. Opens anterior to vaginal opening. Only urinary function.'),
    ]
    story.append(two_col_table(ub_rows, 'Structure', 'Key Facts', LIGHT_BLUE, CREAM))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 9 — REPRODUCTIVE SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('REPRODUCTIVE SYSTEM',
        'Male & Female Anatomy', ORANGE, '09'))
    story.append(spacer(0.3))

    story.append(Paragraph('Male Reproductive Anatomy', H2))
    male_rows = [
        ('Testes', 'Produce sperm (spermatogenesis) and testosterone. Located in scrotum (lower temperature needed). Seminiferous tubules → sperm production.'),
        ('Epididymis', 'Comma-shaped organ on posterior testis. Sperm mature and stored here (2–3 weeks).'),
        ('Vas Deferens (Ductus Deferens)', '~45 cm duct. Carries sperm from epididymis → ejaculatory duct. Part of spermatic cord.'),
        ('Seminal Vesicles', 'Produce ~60% of seminal fluid (fructose for sperm energy). Located posterior to bladder.'),
        ('Prostate Gland', 'Walnut-sized. Surrounds urethra below bladder. Secretes alkaline fluid (25% semen). Can enlarge → urinary obstruction (BPH).'),
        ('Bulbourethral Glands (Cowper\'s)', 'Secrete pre-ejaculatory fluid to neutralize urethral acidity.'),
        ('Penis', 'Three erectile bodies: 2 corpus cavernosum + 1 corpus spongiosum (surrounds urethra). Glans covered by prepuce (foreskin).'),
    ]
    story.append(two_col_table(male_rows, 'Structure', 'Function & Notes', LIGHT_ORANGE, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Female Reproductive Anatomy', H2))
    female_rows = [
        ('Ovaries', 'Produce eggs (oogenesis) and hormones (oestrogen, progesterone). Located in ovarian fossa of lateral pelvic wall. Suspended by ligaments.'),
        ('Uterine (Fallopian) Tubes', '~10 cm. Carry egg from ovary to uterus. Fertilization normally occurs in ampulla (widest part). Parts: infundibulum, ampulla, isthmus, intramural.'),
        ('Uterus', 'Pear-shaped muscular organ. Layers: perimetrium (outer), myometrium (muscle), endometrium (inner — sheds during menstruation). Body + cervix.'),
        ('Cervix', 'Lower narrow portion of uterus. Internal os + external os. Pap smear taken from here.'),
        ('Vagina', '~8–10 cm fibromuscular canal. Extends from cervix to external genitalia. Birth canal. Rugae allow expansion.'),
        ('External Genitalia (Vulva)', 'Mons pubis, labia majora, labia minora, clitoris, vaginal opening, urethral meatus. Bartholin\'s glands at vaginal entrance.'),
        ('Breasts (Mammary Glands)', 'Modified sweat glands. 15–20 lobes each. Drain via nipple. Lymphatics drain mainly to axillary lymph nodes (important in breast cancer).'),
    ]
    story.append(two_col_table(female_rows, 'Structure', 'Function & Notes', LIGHT_ORANGE, LIGHT_GREEN))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 10 — ENDOCRINE SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('ENDOCRINE SYSTEM',
        'Glands, Hormones & Their Targets', PURPLE, '10'))
    story.append(spacer(0.3))

    story.append(Paragraph('Overview', H2))
    story.append(Paragraph(
        'The endocrine system uses <b>hormones</b> (chemical messengers released into the blood) '
        'to regulate bodily functions. Unlike the nervous system, it acts slowly but with prolonged effects.', BODY))

    endo_rows = [
        ('Hypothalamus', 'Brain (diencephalon)', 'Releasing/inhibiting hormones (CRH, TRH, GnRH, GHRH, somatostatin, dopamine). Controls pituitary.'),
        ('Anterior Pituitary', 'Below hypothalamus', 'GH, TSH, ACTH, FSH, LH, Prolactin. "Master gland."'),
        ('Posterior Pituitary', 'Below hypothalamus', 'ADH (vasopressin), Oxytocin — made in hypothalamus, stored here.'),
        ('Thyroid Gland', 'Anterior neck (C5–T1)', 'T3 + T4 (metabolism), Calcitonin (↓ blood calcium).'),
        ('Parathyroid Glands', '4 on posterior thyroid', 'PTH — raises blood calcium (↑ bone resorption, ↑ renal Ca reabsorption, ↑ vitamin D activation).'),
        ('Adrenal Cortex', 'Top of each kidney', 'Cortisol (stress, metabolism), Aldosterone (Na/K balance), Androgens.'),
        ('Adrenal Medulla', 'Inner adrenal gland', 'Adrenaline (epinephrine) + Noradrenaline — "fight or flight."'),
        ('Pancreas (Islets)', 'Behind stomach', 'Insulin (β cells — ↓ blood glucose), Glucagon (α cells — ↑ blood glucose).'),
        ('Gonads — Ovaries', 'Pelvis (female)', 'Oestrogen (secondary sex characteristics, uterus), Progesterone (pregnancy).'),
        ('Gonads — Testes', 'Scrotum (male)', 'Testosterone (secondary sex characteristics, sperm production).'),
        ('Pineal Gland', 'Brain (epithalamus)', 'Melatonin — regulates sleep-wake cycle (circadian rhythm).'),
        ('Thymus', 'Superior mediastinum', 'Thymosin — T-lymphocyte maturation. Most active in childhood.'),
    ]
    story.append(three_col_table(endo_rows, ['Gland', 'Location', 'Hormone(s) & Function']))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 11 — LYMPHATIC SYSTEM
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('LYMPHATIC & IMMUNE SYSTEM',
        'Lymph Nodes, Spleen, Thymus & Lymphatics', TEAL, '11'))
    story.append(spacer(0.3))

    story.append(Paragraph('Overview', H2))
    story.append(Paragraph(
        'The lymphatic system has three main functions: (1) returns excess interstitial fluid to the blood, '
        '(2) absorbs dietary fat from the small intestine, and (3) defends against infection (immune function).', BODY))

    story.append(Paragraph('Key Lymphatic Structures', H2))
    lymph_rows = [
        ('Lymph Capillaries', 'Blind-ended tubes in most tissues. Collect interstitial fluid → lymph.'),
        ('Lymph Vessels', 'Carry lymph toward the heart. Have valves. Eventually drain into thoracic duct or right lymphatic duct.'),
        ('Thoracic Duct', 'Largest lymph vessel. Drains lymph from lower body + left upper body → left subclavian vein.'),
        ('Right Lymphatic Duct', 'Drains lymph from right upper body → right subclavian vein.'),
        ('Lymph Nodes', 'Bean-shaped organs along lymph vessels. Filter lymph + house lymphocytes. Enlarged in infection/cancer.'),
        ('Spleen', 'Largest lymphoid organ. In left upper abdomen. Filters blood, destroys old RBCs, immune response.'),
        ('Thymus', 'In superior mediastinum. T-lymphocytes mature here. Largest in childhood, atrophies after puberty.'),
        ('Tonsils', 'Ring of lymphoid tissue (Waldeyer\'s ring) at entrance to pharynx. First line of immune defence.'),
        ('MALT', 'Mucosa-Associated Lymphoid Tissue — Peyer\'s patches in small intestine + lymphoid tissue in mucous membranes.'),
    ]
    story.append(two_col_table(lymph_rows, 'Structure', 'Description', LIGHT_TEAL, CREAM))

    story.append(spacer(0.2))
    story.append(info_box('Important Lymph Node Groups to Know',
        ['Cervical lymph nodes — drain head and neck (enlarged in throat infection, lymphoma)',
         'Axillary lymph nodes — drain upper limb + breast (important in breast cancer staging)',
         'Inguinal lymph nodes — drain lower limb + perineum (enlarged in STIs, lymphoma)',
         'Mesenteric lymph nodes — drain GI tract (enlarged in appendicitis, IBD)',
         'Mediastinal lymph nodes — drain lungs and thoracic organs'],
        LIGHT_TEAL, TEAL))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 12 — HEAD & NECK
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('HEAD & NECK',
        'Skull, Brain Covering, Orbit, Ear, Throat & Vessels', DARK_BLUE, '12'))
    story.append(spacer(0.3))

    story.append(Paragraph('Skull Bones', H2))
    skull_rows = [
        ('Frontal', '1', 'Forehead, roof of orbits, anterior cranial fossa'),
        ('Parietal', '2', 'Top and sides of skull'),
        ('Temporal', '2', 'Sides of skull. Contains ear structures, mastoid process, styloid process'),
        ('Occipital', '1', 'Posterior skull. Foramen magnum for brainstem. Occipital condyles on atlas (C1)'),
        ('Sphenoid', '1', 'Central skull base. "Bat-wing" shape. Sella turcica holds pituitary gland.'),
        ('Ethmoid', '1', 'Between eyes. Forms part of nasal septum and medial orbital wall'),
    ]
    story.append(three_col_table(skull_rows, ['Bone', 'Count', 'Key Features']))

    story.append(spacer(0.2))
    story.append(Paragraph('Triangles of the Neck', H2))
    story.append(Paragraph(
        'The neck is divided by the sternocleidomastoid (SCM) muscle into anterior and posterior triangles.', BODY))
    story.append(bullet('<b>Anterior Triangle</b> — bounded by midline, SCM, and mandible. Contains carotid arteries, jugular veins, thyroid gland.'))
    story.append(bullet('<b>Posterior Triangle</b> — bounded by SCM, trapezius, and clavicle. Contains brachial plexus, subclavian artery, cervical lymph nodes.'))

    story.append(spacer(0.2))
    story.append(Paragraph('Major Vessels of the Head & Neck', H2))
    vessel_hn_rows = [
        ('Common Carotid Artery', 'Main arterial supply to head. Bifurcates at C4 into internal + external carotid.'),
        ('Internal Carotid', 'Supplies brain (enters skull through carotid canal). No branches in neck.'),
        ('External Carotid', 'Supplies face, scalp, neck. Has many branches: facial, lingual, occipital, maxillary, superficial temporal.'),
        ('Vertebral Artery', 'Branches of subclavian. Ascend through transverse foramina of C6-C1 → basilar artery.'),
        ('Internal Jugular Vein', 'Main venous drainage from brain. Drains into brachiocephalic vein.'),
        ('External Jugular Vein', 'Drains superficial face/scalp. Visible on neck. Drains into subclavian vein.'),
    ]
    story.append(two_col_table(vessel_hn_rows, 'Vessel', 'Details', LIGHT_BLUE, CREAM))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 13 — UPPER LIMB
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('UPPER LIMB',
        'Shoulder, Arm, Forearm, Wrist & Hand', TEAL, '13'))
    story.append(spacer(0.3))

    story.append(Paragraph('Bones of the Upper Limb', H2))
    ul_bone_rows = [
        ('Clavicle', 'Collar bone. Only bony connection between upper limb and axial skeleton.'),
        ('Scapula', 'Shoulder blade. Has glenoid cavity (socket for glenohumeral joint), acromion, coracoid process.'),
        ('Humerus', 'Upper arm bone. Head fits into glenoid (shoulder joint). Distal end has trochlea (elbow).'),
        ('Radius', 'Lateral forearm bone. Rotates to allow supination/pronation. Articulates with wrist.'),
        ('Ulna', 'Medial forearm bone. Olecranon process = "funny bone" area. Trochlear notch articulates with humerus.'),
        ('Carpals', '8 wrist bones in two rows. Proximal: Scaphoid, Lunate, Triquetrum, Pisiform. Distal: Trapezium, Trapezoid, Capitate, Hamate.'),
        ('Metacarpals', '5 bones forming the palm.'),
        ('Phalanges', '14 bones of fingers (3 per finger, 2 in thumb).'),
    ]
    story.append(two_col_table(ul_bone_rows, 'Bone', 'Key Features', LIGHT_TEAL, CREAM))

    story.append(spacer(0.2))
    story.append(mnemonic('"<b>S</b>he <b>L</b>ooks <b>T</b>oo <b>P</b>retty, <b>T</b>ry <b>T</b>o <b>C</b>atch <b>H</b>er" = Scaphoid, Lunate, Triquetrum, Pisiform, Trapezium, Trapezoid, Capitate, Hamate'))

    story.append(spacer(0.2))
    story.append(Paragraph('Brachial Plexus — Nerves of Upper Limb', H2))
    story.append(Paragraph(
        'The brachial plexus (C5–T1) is the nerve network supplying the entire upper limb. '
        'It forms in the posterior triangle of the neck and axilla.', BODY))
    bp_rows = [
        ('Musculocutaneous (C5-C7)', 'Flexes elbow (biceps, brachialis). Sensory: lateral forearm.'),
        ('Median (C6-T1)', '"Handcuff nerve." Thenar muscles, flexors of wrist/fingers. Sensory: lateral palm + fingers. Carpal tunnel.'),
        ('Ulnar (C8-T1)', '"Funny bone nerve." Intrinsic hand muscles. Sensory: medial 1.5 fingers. Damaged at medial epicondyle → claw hand.'),
        ('Radial (C5-T1)', '"Saturday night palsy nerve." Extends wrist/fingers/elbow. Sensory: posterior arm/forearm. Damaged in axilla/spiral groove.'),
        ('Axillary (C5-C6)', 'Deltoid (shoulder abduction), teres minor. Sensory: lateral arm. Damaged in shoulder dislocation.'),
    ]
    story.append(two_col_table(bp_rows, 'Nerve (Roots)', 'Function & Clinical Notes', LIGHT_TEAL, CREAM))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 14 — LOWER LIMB
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('LOWER LIMB',
        'Hip, Thigh, Leg, Ankle & Foot', MED_BLUE, '14'))
    story.append(spacer(0.3))

    story.append(Paragraph('Bones of the Lower Limb', H2))
    ll_bone_rows = [
        ('Hip Bone (Os Coxae)', 'Three fused bones: Ilium (blade), Ischium (sit bone), Pubis. Two hip bones + sacrum + coccyx = pelvis.'),
        ('Femur', 'Longest bone. Head articulates with acetabulum (hip joint). Neck → shaft → condyles.'),
        ('Patella', 'Sesamoid bone in quadriceps tendon. Protects knee joint.'),
        ('Tibia', 'Medial, weight-bearing leg bone. Tibial plateau at knee. Medial malleolus at ankle.'),
        ('Fibula', 'Lateral, non-weight-bearing leg bone. Lateral malleolus at ankle.'),
        ('Tarsals', '7 bones. Talus (articulates with leg), Calcaneus (heel), 5 others.'),
        ('Metatarsals', '5 bones forming the foot arch.'),
        ('Phalanges', '14 toe bones (3 per toe, 2 in big toe).'),
    ]
    story.append(two_col_table(ll_bone_rows, 'Bone', 'Key Features', LIGHT_BLUE, CREAM))

    story.append(spacer(0.2))
    story.append(Paragraph('Nerves of the Lower Limb (Lumbosacral Plexus)', H2))
    ll_nerve_rows = [
        ('Femoral (L2-L4)', 'Supplies quadriceps (extend knee), hip flexors. Sensory: medial leg + anterior thigh.'),
        ('Obturator (L2-L4)', 'Supplies medial (adductor) compartment. Sensory: medial thigh.'),
        ('Sciatic (L4-S3)', 'Largest nerve in body. Divides in popliteal fossa into tibial + common peroneal.'),
        ('Tibial (L4-S3)', 'Supplies posterior leg muscles (plantar flexion). Sensory: sole of foot.'),
        ('Common Peroneal/Fibular (L4-S2)', 'Supplies anterior + lateral leg (dorsiflexion, eversion). Sensory: dorsum of foot. Damaged at fibular neck → foot drop.'),
        ('Superior Gluteal (L4-S1)', 'Gluteus medius + minimus. Hip abduction.'),
        ('Inferior Gluteal (L5-S2)', 'Gluteus maximus. Hip extension.'),
    ]
    story.append(two_col_table(ll_nerve_rows, 'Nerve (Roots)', 'Function & Clinical Notes', LIGHT_BLUE, CREAM))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 15 — BACK & SPINE
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('BACK & SPINE',
        'Vertebral Column, Spinal Cord & Back Muscles', DARK_BLUE, '15'))
    story.append(spacer(0.3))

    story.append(Paragraph('The Vertebral Column', H2))
    story.append(Paragraph(
        'The vertebral column consists of <b>33 vertebrae</b> in 5 regions. '
        'It protects the spinal cord, supports the skull, and provides attachment for muscles and ribs.', BODY))
    vert_rows = [
        ('Cervical', '7 (C1–C7)', 'Smallest. C1 = Atlas (supports skull). C2 = Axis (has dens/odontoid peg for rotation). All have transverse foramina for vertebral arteries.'),
        ('Thoracic', '12 (T1–T12)', 'Articulate with ribs. Heart-shaped bodies. Long spinous processes pointing inferiorly.'),
        ('Lumbar', '5 (L1–L5)', 'Largest vertebrae. Kidney-shaped bodies. No transverse foramina or rib facets. Strong — weight-bearing.'),
        ('Sacrum', '5 fused', 'Wedge-shaped. Connects vertebral column to pelvis. Sacral foramina for spinal nerves.'),
        ('Coccyx', '4 fused', 'Tail bone. Attachment for muscles of pelvic floor.'),
    ]
    story.append(three_col_table(vert_rows, ['Region', 'Vertebrae', 'Key Features']))

    story.append(spacer(0.2))
    story.append(mnemonic('"<b>C</b>hristmas <b>T</b>rees <b>L</b>eak <b>S</b>ap <b>C</b>onstantly" = Cervical 7, Thoracic 12, Lumbar 5, Sacral 5, Coccygeal — 7+12+5+5+4 = 33'))

    story.append(spacer(0.2))
    story.append(Paragraph('Spinal Cord', H2))
    story.append(Paragraph(
        'The spinal cord extends from the foramen magnum to <b>L1–L2</b> in adults (conus medullaris). '
        'Below this, nerve roots continue as the <b>cauda equina</b> ("horse\'s tail").', BODY))
    story.append(bullet('<b>Grey matter</b> — butterfly/H-shaped. Contains neuron cell bodies. Dorsal horn (sensory), ventral horn (motor).'))
    story.append(bullet('<b>White matter</b> — surrounds grey matter. Contains myelinated axons (ascending + descending tracts).'))
    story.append(bullet('<b>Lumbar puncture</b> done at L3–L4 or L4–L5 (below conus medullaris to avoid cord damage).'))

    story.append(spacer(0.2))
    story.append(Paragraph('Intervertebral Discs', H2))
    story.append(Paragraph(
        'Located between vertebral bodies (except C1-C2). Made of:', BODY))
    story.append(bullet('<b>Nucleus pulposus</b> — central gelatinous core. Acts as shock absorber.'))
    story.append(bullet('<b>Annulus fibrosus</b> — tough outer fibrocartilage ring. Holds nucleus in place.'))
    story.append(key('CLINICAL NOTE: Prolapsed (herniated) disc — nucleus pulposus herniates through annulus → compresses nearby nerve root → pain, numbness, weakness. Most common at L4–L5 or L5–S1.'))
    story.append(PageBreak())

    # ═══════════════════════════════════════════════════════════════════════════
    # CHAPTER 16 — QUICK REVISION TABLES
    # ═══════════════════════════════════════════════════════════════════════════
    story.append(section_header('QUICK REVISION TABLES',
        'High-Yield Facts for Exams', ORANGE, '16'))
    story.append(spacer(0.3))

    story.append(Paragraph('Key Numbers to Memorise', H2))
    numbers_rows = [
        ('Total bones in adult body', '206'),
        ('Vertebrae (cervical / thoracic / lumbar / sacral / coccygeal)', '7 / 12 / 5 / 5 / 4 = 33'),
        ('Pairs of ribs', '12 (true: 1-7; false: 8-10; floating: 11-12)'),
        ('Cranial bones', '8'),
        ('Facial bones', '14'),
        ('Pairs of cranial nerves', '12'),
        ('Carpal bones', '8'),
        ('Tarsal bones', '7'),
        ('Heart chambers', '4'),
        ('Heart valves', '4'),
        ('Lobes of right / left lung', '3 / 2'),
        ('Approximate alveoli in lungs', '300 million (~70 m² surface area)'),
        ('Length of small intestine', '~6 metres'),
        ('Length of large intestine', '~1.5 metres'),
        ('Nephrons per kidney', '~1 million'),
        ('Normal heart rate', '60–100 bpm'),
        ('Normal blood pressure', '120/80 mmHg'),
        ('Tidal volume (normal breath)', '~500 mL'),
        ('Total lung capacity', '~6000 mL'),
        ('pH of blood (normal range)', '7.35–7.45'),
    ]
    story.append(two_col_table(numbers_rows, 'Fact', 'Value', LIGHT_BLUE, CREAM))

    story.append(spacer(0.3))
    story.append(Paragraph('Commonly Tested Clinical Anatomy Points', H2))
    clinical_rows = [
        ('McBurney\'s Point', 'Appendix location — 1/3 of way from ASIS to umbilicus. Tenderness = appendicitis.'),
        ('Lumbar Puncture Site', 'L3–L4 or L4–L5. Below conus medullaris (ends L1–L2). Patient flexed forward.'),
        ('Femoral Triangle', 'Bounded by inguinal ligament, sartorius, adductor longus. Contains: NAVEL — Nerve, Artery, Vein, Empty space, Lymphatics (lateral → medial).'),
        ('Cubital Fossa', 'Front of elbow. Contents (lateral → medial): Radial Nerve, Biceps Tendon, Brachial Artery, Median Nerve. "Really Bend Beyond My Arm."'),
        ('Carotid Bifurcation Level', 'C4 vertebral level. Carotid sinus + body here.'),
        ('Sternal Angle (Angle of Louis)', 'T4/T5 level. Tracheal bifurcation (carina). Azygos vein drains into SVC. 2nd rib.'),
        ('Spleen Location', 'Left hypochondriac region. 9th-11th ribs posterolaterally. NOT palpable when normal.'),
        ('Liver Dullness Area', 'Percuss right 5th intercostal space MCL to right costal margin.'),
        ('Foot Drop', 'Common peroneal nerve damage (fibular neck fracture). Cannot dorsiflex.'),
        ('Wrist Drop', 'Radial nerve damage (fracture of radial shaft / "Saturday night palsy"). Cannot extend wrist.'),
        ('Claw Hand', 'Ulnar nerve damage. Ring + little fingers clawed. Interosseous wasting.'),
        ('Median Nerve at Wrist', 'Carpal tunnel syndrome. Thenar wasting. Tingling in lateral 3.5 fingers.'),
    ]
    story.append(two_col_table(clinical_rows, 'Topic', 'Key Point', LIGHT_ORANGE, CREAM))

    story.append(spacer(0.3))
    story.append(Paragraph('Foramina of the Skull & Structures Passing Through', H2))
    foramina_rows = [
        ('Cribriform plate (ethmoid)', 'Olfactory nerve (CN I)'),
        ('Optic canal (sphenoid)', 'Optic nerve (CN II) + ophthalmic artery'),
        ('Superior orbital fissure', 'CN III, IV, V1, VI + superior ophthalmic vein'),
        ('Foramen rotundum', 'CN V2 (maxillary)'),
        ('Foramen ovale', 'CN V3 (mandibular) + lesser petrosal nerve'),
        ('Foramen spinosum', 'Middle meningeal artery'),
        ('Internal acoustic meatus', 'CN VII (facial) + CN VIII (vestibulocochlear)'),
        ('Jugular foramen', 'CN IX, X, XI + internal jugular vein'),
        ('Hypoglossal canal', 'CN XII (hypoglossal)'),
        ('Foramen magnum', 'Brainstem (medulla), vertebral arteries, CN XI'),
    ]
    story.append(two_col_table(foramina_rows, 'Foramen', 'Structures Passing Through', LIGHT_PURPLE, CREAM))

    story.append(spacer(0.3))
    story.append(hr())
    story.append(spacer(0.2))
    story.append(Paragraph(
        'This guide covers the essential anatomy for exam success. Review each system systematically, '
        'use the mnemonics, and practise clinical application. Good luck with your examinations!',
        ParagraphStyle('Final', fontName='Helvetica-Oblique', fontSize=11,
            textColor=DARK_BLUE, alignment=TA_CENTER, leading=16)))
    story.append(spacer(0.2))
    story.append(Paragraph(
        'Reference: Gray\'s Anatomy for Students (Elsevier) | Standard Medical Curricula',
        CAPTION))

    return story


# ══════════════════════════════════════════════════════════════════════════════
#  BUILD PDF
# ══════════════════════════════════════════════════════════════════════════════
if __name__ == '__main__':
    output_path = '/home/daytona/workspace/anatomy-pdf/Complete_Human_Anatomy_Exam_Guide.pdf'

    doc = SimpleDocTemplate(
        output_path,
        pagesize=A4,
        topMargin=1.5*cm,
        bottomMargin=1.2*cm,
        leftMargin=1.8*cm,
        rightMargin=1.8*cm,
        title='Complete Human Anatomy — Exam Preparation Guide',
        author='Orris Medical Education',
        subject='Human Anatomy',
    )

    story = build_story()

    doc.build(story,
              onFirstPage=on_first_page,
              onLaterPages=on_later_pages)

    print(f'✅ PDF successfully created: {output_path}')
    import os
    size = os.path.getsize(output_path)
    print(f'   File size: {size/1024:.1f} KB')
This is a shared conversation. Sign in to Orris to start your own chat.