/**
 * Pediatric Preventive Care Schedule Data
 * Sources:
 *   - AAP/Bright Futures Recommendations for Preventive Pediatric Health Care (February 2025)
 *   - CDC Child and Adolescent Immunization Schedule (2025)
 */

// ─── LEGEND ──────────────────────────────────────────────────────────────────
// "dot"   = recommended / to be performed
// "risk"  = risk assessment to be performed; action follows if positive
// "range" = service may be provided within this range
// ""      = not indicated at this visit

// ─── VISIT AGES ──────────────────────────────────────────────────────────────
const VISIT_AGES = [
  { id: "prenatal",   label: "Prenatal",   era: "prenatal" },
  { id: "newborn",    label: "Newborn",    era: "infancy" },
  { id: "3-5d",       label: "3–5 Days",   era: "infancy" },
  { id: "1mo",        label: "1 Month",    era: "infancy" },
  { id: "2mo",        label: "2 Months",   era: "infancy" },
  { id: "4mo",        label: "4 Months",   era: "infancy" },
  { id: "6mo",        label: "6 Months",   era: "infancy" },
  { id: "9mo",        label: "9 Months",   era: "infancy" },
  { id: "12mo",       label: "12 Months",  era: "infancy" },
  { id: "15mo",       label: "15 Months",  era: "infancy" },
  { id: "18mo",       label: "18 Months",  era: "infancy" },
  { id: "24mo",       label: "24 Months",  era: "earlyChildhood" },
  { id: "30mo",       label: "30 Months",  era: "earlyChildhood" },
  { id: "3y",         label: "3 Years",    era: "earlyChildhood" },
  { id: "4y",         label: "4 Years",    era: "earlyChildhood" },
  { id: "5y",         label: "5 Years",    era: "earlyChildhood" },
  { id: "6y",         label: "6 Years",    era: "middleChildhood" },
  { id: "7y",         label: "7 Years",    era: "middleChildhood" },
  { id: "8y",         label: "8 Years",    era: "middleChildhood" },
  { id: "9y",         label: "9 Years",    era: "middleChildhood" },
  { id: "10y",        label: "10 Years",   era: "middleChildhood" },
  { id: "11y",        label: "11 Years",   era: "adolescence" },
  { id: "12y",        label: "12 Years",   era: "adolescence" },
  { id: "13y",        label: "13 Years",   era: "adolescence" },
  { id: "14y",        label: "14 Years",   era: "adolescence" },
  { id: "15y",        label: "15 Years",   era: "adolescence" },
  { id: "16y",        label: "16 Years",   era: "adolescence" },
  { id: "17y",        label: "17 Years",   era: "adolescence" },
  { id: "18y",        label: "18 Years",   era: "adolescence" },
  { id: "19y",        label: "19 Years",   era: "adolescence" },
  { id: "20y",        label: "20 Years",   era: "adolescence" },
  { id: "21y",        label: "21 Years",   era: "adolescence" },
];

// ─── BILLING / DIAGNOSIS CODES ───────────────────────────────────────────────
const WELL_VISIT_CODES = {
  newborn:  { icd10: "Z00.110", description: "Health exam for newborn under 8 days old", cpt: "99460/99461/99462" },
  "3-5d":   { icd10: "Z00.110", description: "Health exam for newborn under 8 days old", cpt: "99460/99461" },
  "1mo":    { icd10: "Z00.129", description: "Encounter for routine child health exam, without abnormal findings (0–28 days: use Z00.110; 29 days–1 yr: Z00.129)", cpt: "99391" },
  "2mo":    { icd10: "Z00.129", description: "Health exam, infant/child (29 days–1 year)", cpt: "99391" },
  "4mo":    { icd10: "Z00.129", description: "Health exam, infant/child (29 days–1 year)", cpt: "99391" },
  "6mo":    { icd10: "Z00.129", description: "Health exam, infant/child (29 days–1 year)", cpt: "99391" },
  "9mo":    { icd10: "Z00.129", description: "Health exam, infant/child (29 days–1 year)", cpt: "99391" },
  "12mo":   { icd10: "Z00.129", description: "Health exam, infant/child (29 days–1 year)", cpt: "99392" },
  "15mo":   { icd10: "Z00.121", description: "Health exam for child over 28 days (1–4 years: Z00.121)", cpt: "99392" },
  "18mo":   { icd10: "Z00.121", description: "Health exam, early childhood (1–4 years)", cpt: "99392" },
  "24mo":   { icd10: "Z00.121", description: "Health exam, early childhood (1–4 years)", cpt: "99392" },
  "30mo":   { icd10: "Z00.121", description: "Health exam, early childhood (1–4 years)", cpt: "99392" },
  "3y":     { icd10: "Z00.121", description: "Health exam, early childhood (1–4 years)", cpt: "99392" },
  "4y":     { icd10: "Z00.121", description: "Health exam, early childhood (1–4 years)", cpt: "99392" },
  "5y":     { icd10: "Z00.129", description: "Health exam, child (5–11 years: Z00.129)", cpt: "99393" },
  "6y":     { icd10: "Z00.129", description: "Health exam, child (5–11 years)", cpt: "99393" },
  "7y":     { icd10: "Z00.129", description: "Health exam, child (5–11 years)", cpt: "99393" },
  "8y":     { icd10: "Z00.129", description: "Health exam, child (5–11 years)", cpt: "99393" },
  "9y":     { icd10: "Z00.129", description: "Health exam, child (5–11 years)", cpt: "99393" },
  "10y":    { icd10: "Z00.129", description: "Health exam, child (5–11 years)", cpt: "99393" },
  "11y":    { icd10: "Z00.129", description: "Health exam, child (5–11 years)", cpt: "99393" },
  "12y":    { icd10: "Z00.129", description: "Health exam, adolescent (12–17 years: Z00.129)", cpt: "99394" },
  "13y":    { icd10: "Z00.129", description: "Health exam, adolescent (12–17 years)", cpt: "99394" },
  "14y":    { icd10: "Z00.129", description: "Health exam, adolescent (12–17 years)", cpt: "99394" },
  "15y":    { icd10: "Z00.129", description: "Health exam, adolescent (12–17 years)", cpt: "99394" },
  "16y":    { icd10: "Z00.129", description: "Health exam, adolescent (12–17 years)", cpt: "99394" },
  "17y":    { icd10: "Z00.129", description: "Health exam, adolescent (12–17 years)", cpt: "99394" },
  "18y":    { icd10: "Z00.00",  description: "Health exam, adult (18–21 years: Z00.00 or Z00.01)", cpt: "99395" },
  "19y":    { icd10: "Z00.00",  description: "Health exam, adult", cpt: "99395" },
  "20y":    { icd10: "Z00.00",  description: "Health exam, adult", cpt: "99395" },
  "21y":    { icd10: "Z00.00",  description: "Health exam, adult", cpt: "99395" },
};

// ─── VACCINE MASTER LIST ─────────────────────────────────────────────────────
const VACCINES = {
  HepB: {
    fullName: "Hepatitis B vaccine",
    abbreviation: "HepB",
    brandNames: ["Engerix-B", "Recombivax HB", "Heplisav-B (age 18+)", "PreHevbrio (age 18+)"],
    totalDoses: 3,
    icd10Admin: "Z23",
    cvxCodes: ["08"],
  },
  RV: {
    fullName: "Rotavirus vaccine",
    abbreviation: "RV1 / RV5",
    brandNames: ["Rotarix (RV1, 2-dose)", "RotaTeq (RV5, 3-dose)"],
    totalDoses: "2 (Rotarix) or 3 (RotaTeq)",
    cvxCodes: ["119", "116"],
  },
  DTaP: {
    fullName: "Diphtheria, tetanus, and acellular pertussis vaccine (pediatric)",
    abbreviation: "DTaP",
    brandNames: ["Daptacel", "Infanrix", "Pediarix (combo)", "Pentacel (combo)", "Vaxelis (combo)"],
    totalDoses: 5,
    cvxCodes: ["20", "106", "107", "146"],
  },
  Tdap: {
    fullName: "Tetanus, diphtheria, and acellular pertussis vaccine (adolescent/adult)",
    abbreviation: "Tdap",
    brandNames: ["Adacel", "Boostrix"],
    totalDoses: 1,
    cvxCodes: ["115"],
  },
  Td: {
    fullName: "Tetanus and diphtheria toxoids vaccine",
    abbreviation: "Td",
    brandNames: ["Tenivac", "Td Generic"],
    totalDoses: "booster every 10 years",
    cvxCodes: ["09", "113"],
  },
  Hib: {
    fullName: "Haemophilus influenzae type b conjugate vaccine",
    abbreviation: "Hib",
    brandNames: ["ActHIB", "Hiberix", "PedvaxHIB", "Pentacel (combo)", "Vaxelis (combo)"],
    totalDoses: "3 (PedvaxHIB) or 4 (others)",
    cvxCodes: ["17", "22", "46", "47", "148"],
  },
  PCV: {
    fullName: "Pneumococcal conjugate vaccine",
    abbreviation: "PCV15 / PCV20",
    brandNames: ["Vaxneuvance (PCV15)", "Prevnar 20 (PCV20)", "Prevnar 13 (PCV13, legacy)"],
    totalDoses: 4,
    cvxCodes: ["133", "215", "152"],
  },
  PPSV23: {
    fullName: "Pneumococcal polysaccharide vaccine",
    abbreviation: "PPSV23",
    brandNames: ["Pneumovax 23"],
    totalDoses: "1–2 (high-risk only for children)",
    cvxCodes: ["33"],
  },
  IPV: {
    fullName: "Inactivated poliovirus vaccine",
    abbreviation: "IPV",
    brandNames: ["IPOL", "Pediarix (combo)", "Pentacel (combo)", "Vaxelis (combo)"],
    totalDoses: 4,
    cvxCodes: ["10"],
  },
  Flu_IIV: {
    fullName: "Influenza vaccine, inactivated or recombinant",
    abbreviation: "IIV4 / ccIIV4 / RIV4",
    brandNames: ["Fluzone", "Flucelvax (ccIIV4)", "Fluad (age 65+)", "Flublok (RIV4)"],
    totalDoses: "1–2 annually (2 doses first season if <9 yrs and vaccine-naive)",
    cvxCodes: ["141", "150", "158", "161"],
  },
  Flu_LAIV: {
    fullName: "Influenza vaccine, live attenuated intranasal",
    abbreviation: "LAIV4",
    brandNames: ["FluMist"],
    totalDoses: "1–2 annually (age 2+)",
    notes: "Not for ages <2, immunocompromised, pregnancy, or certain medical conditions",
    cvxCodes: ["111"],
  },
  MMR: {
    fullName: "Measles, mumps, and rubella vaccine",
    abbreviation: "MMR",
    brandNames: ["M-M-R II", "MMRV (Proquad, combo with varicella)"],
    totalDoses: 2,
    cvxCodes: ["03", "94"],
  },
  VAR: {
    fullName: "Varicella (chickenpox) vaccine",
    abbreviation: "VAR",
    brandNames: ["Varivax", "MMRV (Proquad, combo)"],
    totalDoses: 2,
    cvxCodes: ["21", "94"],
  },
  HepA: {
    fullName: "Hepatitis A vaccine",
    abbreviation: "HepA",
    brandNames: ["Havrix", "Vaqta", "Twinrix (HepA-HepB combo, age 18+)"],
    totalDoses: 2,
    cvxCodes: ["83", "85"],
  },
  MenACWY: {
    fullName: "Meningococcal ACWY conjugate vaccine",
    abbreviation: "MenACWY",
    brandNames: ["Menveo (MenACWY-CRM)", "MenQuadfi (MenACWY-TT)", "Menactra (MenACWY-D, legacy)", "Penbraya (combo with MenB)"],
    totalDoses: 2,
    cvxCodes: ["114", "136", "203"],
  },
  MenB: {
    fullName: "Meningococcal B vaccine",
    abbreviation: "MenB",
    brandNames: ["Bexsero (MenB-4C)", "Trumenba (MenB-FHbp)", "Penbraya (combo with MenACWY)"],
    totalDoses: "2–3",
    cvxCodes: ["162", "163"],
  },
  HPV: {
    fullName: "Human papillomavirus vaccine",
    abbreviation: "HPV",
    brandNames: ["Gardasil 9 (9vHPV)"],
    totalDoses: "2 (if started age 9–14) or 3 (if started age 15+)",
    cvxCodes: ["165"],
  },
  COVID: {
    fullName: "COVID-19 vaccine",
    abbreviation: "COVID-19",
    brandNames: ["Moderna (mRNA-1273)", "Pfizer-BioNTech (BNT162b2)", "Novavax (adjuvanted protein subunit)"],
    totalDoses: "annual updated dose; shared clinical decision-making",
    cvxCodes: ["207", "208", "211", "212", "213", "217", "218", "219", "221", "228", "229", "230"],
  },
  RSV_mAb: {
    fullName: "Respiratory syncytial virus monoclonal antibody (Nirsevimab)",
    abbreviation: "RSV-mAb",
    brandNames: ["Beyfortus (nirsevimab)"],
    totalDoses: "1 (seasonal)",
    notes: "Not a vaccine; passive immunization. Ages 0–19 months per risk",
    cvxCodes: ["304"],
  },
  RSV_vaccine: {
    fullName: "Respiratory syncytial virus vaccine (maternal)",
    abbreviation: "RSVv (Abrysvo)",
    brandNames: ["Abrysvo"],
    totalDoses: "1 (in pregnancy, 32–36 weeks, September–January)",
    cvxCodes: ["300"],
  },
  Dengue: {
    fullName: "Dengue tetravalent vaccine, live attenuated",
    abbreviation: "DEN4CYD",
    brandNames: ["Dengvaxia"],
    totalDoses: "3 (0, 6, 12 months)",
    notes: "Ages 9–16 in endemic areas with confirmed prior dengue infection only",
    cvxCodes: ["56"],
  },
  Mpox: {
    fullName: "Mpox (monkeypox) vaccine, modified vaccinia Ankara",
    abbreviation: "JYNNEOS",
    brandNames: ["JYNNEOS"],
    totalDoses: 2,
    notes: "Age 18+; risk-based",
    cvxCodes: ["206"],
  },
};

// ─── AAP PERIODICITY TABLE ────────────────────────────────────────────────────
// Structured per visit age. Keys under each visit:
//   measurements, sensory, developmental, procedures, screenings, anticipatoryGuidance
// Values: "dot" | "risk" | "range" | ""
// Notes footnote numbers reference the AAP footnote list at bottom of this file.

const PERIODICITY = {
  prenatal: {
    icd10: "Z34.xx (antenatal care)",
    history: "dot",
    measurements: {
      lengthHeight: "", weight: "", headCircumference: "", weightForLength: "",
      bmi: "", bloodPressure: ""
    },
    sensory: { vision: "", hearing: "" },
    developmental: {
      maternalDepression: "", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "", behavioralScreening: "",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "", anemia: "", lead: "", tuberculosis: "",
      dyslipidemia: "", sti: "", hiv: "", hepB: "", hepC: "",
      suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    notes: "Prenatal visit recommended for high-risk parents, first-time parents, or those who request. Includes anticipatory guidance, medical history, breastfeeding discussion."
  },

  newborn: {
    icd10: "Z00.110",
    cpt: "99460 (initial hospital/birthing center) or 99461 (other than hospital)",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "dot",       // fn19: confirm state NBS panel
      newbornBilirubin: "dot",   // fn21
      criticalCHD: "dot",        // fn22: pulse ox after 24h before discharge
      immunization: "dot",
      anemia: "", lead: "", tuberculosis: "", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HepB", dose: 1, notes: "Birth dose within 24 hours if birth weight ≥2,000g; within 12 hours if mother HBsAg-positive (with HBIG)" },
      { vaccine: "RSV_mAb", dose: 1, notes: "Nirsevimab if born Oct–Mar and mother unvaccinated or vaccinated <14 days before delivery" }
    ]
  },

  "3-5d": {
    icd10: "Z00.110",
    cpt: "99460/99461",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "dot", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "dot",    // fn20: verify results
      newbornBilirubin: "",
      criticalCHD: "",
      immunization: "dot",
      anemia: "", lead: "", tuberculosis: "", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [],
    notes: "Must occur within 48–72h of hospital discharge. Includes feeding evaluation, jaundice check, formal breastfeeding evaluation."
  },

  "1mo": {
    icd10: "Z00.129",
    cpt: "99391",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "dot", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HepB", dose: 2, notes: "1–2 months; minimum 4 weeks after dose 1" }
    ]
  },

  "2mo": {
    icd10: "Z00.129",
    cpt: "99391",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "dot", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HepB", dose: 2, notes: "If not given at 1 month" },
      { vaccine: "RV",   dose: 1, notes: "Rotarix or RotaTeq — do not start at/after 15 weeks 0 days" },
      { vaccine: "DTaP", dose: 1 },
      { vaccine: "Hib",  dose: 1 },
      { vaccine: "PCV",  dose: 1, notes: "PCV15 or PCV20" },
      { vaccine: "IPV",  dose: 1 },
      { vaccine: "COVID", dose: "per current season recommendation", notes: "Shared clinical decision-making" }
    ]
  },

  "4mo": {
    icd10: "Z00.129",
    cpt: "99391",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "dot", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "RV",   dose: 2 },
      { vaccine: "DTaP", dose: 2 },
      { vaccine: "Hib",  dose: 2 },
      { vaccine: "PCV",  dose: 2 },
      { vaccine: "IPV",  dose: 2 },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "6mo": {
    icd10: "Z00.129",
    cpt: "99391",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "dot", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "dot",   // universal screen at 9–12mo but risk assess at 6mo
      lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "risk",
      fluorideVarnish: "range",   // begin at first tooth eruption
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HepB", dose: 3, notes: "6–18 months; minimum age 24 weeks" },
      { vaccine: "RV",   dose: 3, notes: "RotaTeq only (3-dose series); Rotarix is 2-dose, no dose 3" },
      { vaccine: "DTaP", dose: 3 },
      { vaccine: "Hib",  dose: 3, notes: "ActHIB/Pentacel/Vaxelis 3rd dose; PedvaxHIB does NOT have 6-month dose" },
      { vaccine: "PCV",  dose: 3 },
      { vaccine: "IPV",  dose: 3, notes: "6–18 months" },
      { vaccine: "Flu_IIV", dose: "1st annual dose (2 doses 4 weeks apart if first-ever flu vaccine)", notes: "Start at 6 months annually" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "9mo": {
    icd10: "Z00.129",
    cpt: "99391",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "", autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "dot",   // universal hemoglobin/hematocrit screen at 9–12 months
      lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "risk",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual", notes: "If 2-dose series started at 6mo, 2nd dose here; annually thereafter" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "12mo": {
    icd10: "Z00.129",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "dot",  // 9mo, 18mo, 30mo
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "dot",
      lead: "dot_or_risk",  // fn26: universal or targeted per Medicaid/high-prevalence
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "risk",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HepB",  dose: 3, notes: "If not yet given; series must be complete by 6–18 months" },
      { vaccine: "Hib",   dose: 4, notes: "Booster at 12–15 months (ActHIB, Hiberix); PedvaxHIB booster at 12–15 months" },
      { vaccine: "PCV",   dose: 4, notes: "12–15 months" },
      { vaccine: "MMR",   dose: 1, notes: "12–15 months" },
      { vaccine: "VAR",   dose: 1, notes: "12–15 months" },
      { vaccine: "HepA",  dose: 1, notes: "12–23 months; dose 2 minimum 6 months later" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "15mo": {
    icd10: "Z00.121",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "dot_or_risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "dot",   // fn36: risk assessment at 6 and 12 months
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "DTaP",  dose: 4, notes: "15–18 months; may give as early as 12 months if 6 months since dose 3" },
      { vaccine: "Hib",   dose: 4, notes: "If not yet given at 12 months" },
      { vaccine: "PCV",   dose: 4, notes: "If not yet given at 12 months" },
      { vaccine: "MMR",   dose: 1, notes: "If not yet given at 12 months" },
      { vaccine: "VAR",   dose: 1, notes: "If not yet given at 12 months" },
      { vaccine: "HepA",  dose: 1, notes: "If not yet started" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "18mo": {
    icd10: "Z00.121",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "dot",  // 18 months visit
      autismScreening: "dot",   // 18 months (and 24 months)
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "dot",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "DTaP",  dose: 4, notes: "If not given at 15 months" },
      { vaccine: "HepA",  dose: 2, notes: "Minimum 6 months after dose 1; complete by 23 months" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "RSV_mAb", dose: 1, notes: "Ages 8–19 months high-risk: before second RSV season" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "24mo": {
    icd10: "Z00.121",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "dot",
      weightForLength: "dot", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "dot",  // 30-month visit also
      autismScreening: "dot",   // 24 months
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "dot",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HepA",  dose: 2, notes: "If not completed; ensure 2-dose series done" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "30mo": {
    icd10: "Z00.121",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "", bloodPressure: ""
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "dot",  // formal screen at 30 months
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "dot",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ]
  },

  "3y": {
    icd10: "Z00.121",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "dot", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "dot",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID", dose: "per current season recommendation" }
    ],
    notes: "Vision: acuity screen recommended if cooperative. Blood pressure screening begins at 3 years."
  },

  "4y": {
    icd10: "Z00.121",
    cpt: "99392",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "dot", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "dot",
      fluorideVarnish: "range",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "DTaP",    dose: 5, notes: "4–6 years; dose 5 not needed if dose 4 given at age ≥4 years" },
      { vaccine: "IPV",     dose: 4, notes: "4–6 years; final dose at age ≥4 years, ≥6 months after dose 3" },
      { vaccine: "MMR",     dose: 2, notes: "4–6 years" },
      { vaccine: "VAR",     dose: 2, notes: "4–6 years; minimum 3 months after dose 1" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "5y": {
    icd10: "Z00.129",
    cpt: "99393",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "dot", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk",
      lead: "risk",
      tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: {
      assessment: "risk",
      fluorideVarnish: "",
      fluorideSupplementation: "risk"
    },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "DTaP",    dose: 5, notes: "If not given at 4 years" },
      { vaccine: "IPV",     dose: 4, notes: "If not given at 4 years" },
      { vaccine: "MMR",     dose: 2, notes: "If not given at 4 years" },
      { vaccine: "VAR",     dose: 2, notes: "If not given at 4 years" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "6y": {
    icd10: "Z00.129",
    cpt: "99393",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "7y": {
    icd10: "Z00.129",
    cpt: "99393",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "8y": {
    icd10: "Z00.129",
    cpt: "99393",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "dot", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk", dyslipidemia: "",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "9y": {
    icd10: "Z00.129",
    cpt: "99393",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "", hiv: "", hepB: "", hepC: "", suddenCardiacArrest: "", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",     dose: 1, notes: "May start HPV series at age 9 (earlier start allows 2-dose series through age 14)" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "10y": {
    icd10: "Z00.129",
    cpt: "99393",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: ""
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "", hiv: "", hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",     dose: 1, notes: "If not started at 9 years" },
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "11y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "dot", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk",
      dyslipidemia: "dot",   // universal fasting lipid screen at 9–11 years
      sti: "risk", hiv: "risk", hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",      dose: 1, notes: "Routine start 11–12 years; 2-dose series if starting ages 9–14" },
      { vaccine: "Tdap",     dose: 1, notes: "Single adolescent booster; replaces DTaP" },
      { vaccine: "MenACWY",  dose: 1, notes: "11–12 years; booster dose at 16 years" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ],
    notes: "Hearing screen includes high-frequency audiometry (6,000 and 8,000 Hz) once between ages 11–14."
  },

  "12y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "risk", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "risk", hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",      dose: 2, notes: "Dose 2: minimum 5 months after dose 1 (if started ages 9–14)" },
      { vaccine: "Tdap",     dose: 1, notes: "If not given at 11 years" },
      { vaccine: "MenACWY",  dose: 1, notes: "If not given at 11 years" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ]
  },

  "13y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "risk", hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",      dose: "catch-up", notes: "Catch-up if not started or incomplete; 3-dose series if starting at 13+" },
      { vaccine: "MenACWY",  dose: "catch-up", notes: "Catch-up if not received at 11–12; booster at 16–18 if catch-up dose given at 13–15" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ]
  },

  "14y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "risk", hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",      dose: "catch-up" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ]
  },

  "15y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "dot",   // HIV: screen at least once ages 15–21
      hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "MenACWY",  dose: 2, notes: "Booster at 16 years (range 16–18 if catch-up); minimum 8 weeks after dose 1" },
      { vaccine: "MenB",     dose: 1, notes: "Ages 16–23 shared clinical decision-making; 2-dose series ≥6 months apart" },
      { vaccine: "HPV",      dose: "catch-up" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ],
    notes: "Hearing screen: high-frequency audiometry once between ages 15–17."
  },

  "16y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "dot",
      hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "MenACWY",  dose: 2, notes: "Booster dose at 16; if not yet given" },
      { vaccine: "MenB",     dose: 1, notes: "16–23 years; shared clinical decision-making" },
      { vaccine: "HPV",      dose: "catch-up" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ]
  },

  "17y": {
    icd10: "Z00.129",
    cpt: "99394",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "dot",
      hepB: "", hepC: "",
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "MenACWY",  dose: "catch-up", notes: "If 2-dose series not complete" },
      { vaccine: "MenB",     dose: "catch-up", notes: "Complete series if started" },
      { vaccine: "HPV",      dose: "catch-up", notes: "Catch-up through age 18" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ]
  },

  "18y": {
    icd10: "Z00.00",
    cpt: "99395",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", headCircumference: "",
      weightForLength: "", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      maternalDepression: "", developmentalScreening: "",
      autismScreening: "",
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      newbornBlood: "", newbornBilirubin: "", criticalCHD: "",
      immunization: "dot",
      anemia: "risk", lead: "", tuberculosis: "risk",
      dyslipidemia: "risk",
      sti: "risk", hiv: "dot",
      hepB: "risk",
      hepC: "dot",   // universal HCV screen at least once ages 18–79
      suddenCardiacArrest: "risk", cervicalDysplasia: ""
    },
    oralHealth: { assessment: "risk", fluorideVarnish: "", fluorideSupplementation: "" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "HPV",      dose: "catch-up", notes: "Catch-up through age 18 routinely; shared decision-making ages 19–26" },
      { vaccine: "MenACWY",  dose: "catch-up" },
      { vaccine: "MenB",     dose: "catch-up" },
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ],
    notes: "HCV: universal screen at least once ages 18–79. HIV: screen at least once ages 15–21. Hearing: high-frequency audiometry once between ages 18–21."
  },

  "19y": {
    icd10: "Z00.00",
    cpt: "99395",
    history: "dot",
    measurements: {
      lengthHeight: "dot", weight: "dot", bmi: "dot", bloodPressure: "dot"
    },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      immunization: "dot", anemia: "risk", tuberculosis: "risk",
      dyslipidemia: "risk", sti: "risk", hiv: "dot",
      hepB: "risk", hepC: "dot", suddenCardiacArrest: "risk",
      cervicalDysplasia: "dot"   // Pap smear at age 21; risk assess prior
    },
    oralHealth: { assessment: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV",  dose: "annual" },
      { vaccine: "HPV",      dose: "shared decision-making", notes: "Ages 19–26 if not previously vaccinated or incomplete series" },
      { vaccine: "COVID",    dose: "per current season recommendation" }
    ]
  },

  "20y": {
    icd10: "Z00.00",
    cpt: "99395",
    history: "dot",
    measurements: { lengthHeight: "dot", weight: "dot", bmi: "dot", bloodPressure: "dot" },
    sensory: { vision: "risk", hearing: "risk" },
    developmental: {
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      immunization: "dot", anemia: "risk", tuberculosis: "risk",
      dyslipidemia: "risk", sti: "risk", hiv: "dot",
      hepB: "risk", hepC: "dot",
      suddenCardiacArrest: "risk", cervicalDysplasia: "dot"
    },
    oralHealth: { assessment: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ]
  },

  "21y": {
    icd10: "Z00.00",
    cpt: "99395",
    history: "dot",
    measurements: { lengthHeight: "dot", weight: "dot", bmi: "dot", bloodPressure: "dot" },
    sensory: { vision: "risk", hearing: "dot" },
    developmental: {
      developmentalSurveillance: "dot", behavioralScreening: "dot",
      tobaccoAlcoholDrugs: "risk", depressionSuicideRisk: "dot"
    },
    procedures: {
      immunization: "dot", anemia: "risk", tuberculosis: "risk",
      dyslipidemia: "risk", sti: "risk", hiv: "dot",
      hepB: "risk", hepC: "dot",
      suddenCardiacArrest: "risk", cervicalDysplasia: "dot"
    },
    oralHealth: { assessment: "risk" },
    anticipatoryGuidance: "dot",
    vaccines: [
      { vaccine: "Flu_IIV", dose: "annual" },
      { vaccine: "COVID",   dose: "per current season recommendation" }
    ],
    notes: "Hearing: high-frequency audiometry once between ages 18–21 (complete by this visit if not done)."
  }
};

// ─── CATCH-UP VACCINE SCHEDULE ────────────────────────────────────────────────
const CATCH_UP_SCHEDULE = {
  HepB: {
    minimumAgeForDose1: "Birth",
    series: [
      { dose: 1, minimumAge: "Birth", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "4 weeks", minimumIntervalToPrev: "4 weeks after dose 1" },
      { dose: 3, minimumAge: "24 weeks", minimumIntervalToPrev: "8 weeks after dose 2 AND 16 weeks after dose 1; not before age 24 weeks" }
    ],
    catchUpNotes: "Adolescents age 18: may use 2-dose Heplisav-B (4 weeks apart) or 3-dose PreHevbrio."
  },
  RV: {
    minimumAgeForDose1: "6 weeks",
    maxAgeForDose1: "14 weeks 6 days",
    finalDoseMaxAge: "8 months 0 days",
    series: [
      { dose: 1, minimumAge: "6 weeks", minimumIntervalToPrev: "—", notes: "Do NOT start at/after 15 weeks 0 days" },
      { dose: 2, minimumAge: "10 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 3, minimumAge: "14 weeks", minimumIntervalToPrev: "4 weeks", notes: "RotaTeq only; Rotarix is 2-dose series" }
    ],
    catchUpNotes: "If any dose was RotaTeq or unknown brand, complete as 3-dose series. Do not administer a dose after age 8 months 0 days."
  },
  DTaP: {
    minimumAgeForDose1: "6 weeks",
    series: [
      { dose: 1, minimumAge: "6 weeks", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "10 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 3, minimumAge: "14 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 4, minimumAge: "15 months", minimumIntervalToPrev: "6 months after dose 3", notes: "May give as early as 12 months if 6 months since dose 3 and unlikely to return at 15–18 months" },
      { dose: 5, minimumAge: "4 years", minimumIntervalToPrev: "6 months after dose 4", notes: "Not needed if dose 4 given at age ≥4 years" }
    ]
  },
  Hib: {
    minimumAgeForDose1: "6 weeks",
    series: [
      { dose: 1, minimumAge: "6 weeks", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "10 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 3, minimumAge: "14 weeks", minimumIntervalToPrev: "4 weeks", notes: "Not needed for PedvaxHIB schedule" },
      { dose: 4, minimumAge: "12 months", minimumIntervalToPrev: "8 weeks after dose 3 (or dose 2 if PedvaxHIB)" }
    ],
    catchUpNotes: [
      "Age 12–59 months unvaccinated: 2 doses (8 weeks apart)",
      "Age 15–59 months, ≥1 prior dose: 1 dose",
      "Age ≥5 years: generally not needed unless high-risk (asplenia, HIV, immunoglobulin deficiency, hematopoietic stem cell transplant)",
      "Vaxelis should NOT be used as the Hib booster dose"
    ]
  },
  PCV: {
    minimumAgeForDose1: "6 weeks",
    series: [
      { dose: 1, minimumAge: "6 weeks", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "10 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 3, minimumAge: "14 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 4, minimumAge: "12 months", minimumIntervalToPrev: "8 weeks after dose 3" }
    ],
    catchUpNotes: [
      "Age 12–23 months unvaccinated: 2 doses (8 weeks apart)",
      "Age 24–59 months unvaccinated: 1 dose",
      "Healthy children ages 2–4 with incomplete series: 1 dose PCV",
      "Ages 6–18 with high-risk conditions and never received PCV: 1 dose PCV15 or PCV20"
    ]
  },
  IPV: {
    minimumAgeForDose1: "6 weeks",
    series: [
      { dose: 1, minimumAge: "6 weeks", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "10 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 3, minimumAge: "14 weeks", minimumIntervalToPrev: "4 weeks" },
      { dose: 4, minimumAge: "4 years", minimumIntervalToPrev: "6 months after dose 3; must be ≥4 years old" }
    ],
    catchUpNotes: [
      "Age 4 months–6 years: 4-dose series applies",
      "Age 7–17 unvaccinated: 3-dose primary series (doses at 0, 4–8 weeks, 6–18 months from first dose)",
      "Age 18+: 3-dose series if never immunized; 1 lifetime booster if at increased risk of exposure",
      "tOPV doses given before April 1, 2016 count; tOPV given on/after April 1, 2016 do not count"
    ]
  },
  MMR: {
    minimumAgeForDose1: "12 months",
    series: [
      { dose: 1, minimumAge: "12 months", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "13 months", minimumIntervalToPrev: "4 weeks after dose 1" }
    ],
    catchUpNotes: [
      "Age 6–11 months (international travel): 1 dose; does not count toward 2-dose routine series — revaccinate at 12–15 months",
      "MMRV not recommended for ages 12–47 months (first dose) — give MMR + VAR separately",
      "MMRV not recommended for ages 13–18 years"
    ]
  },
  VAR: {
    minimumAgeForDose1: "12 months",
    series: [
      { dose: 1, minimumAge: "12 months", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "15 months", minimumIntervalToPrev: "3 months if age <13 years; 4 weeks if age ≥13 years" }
    ],
    catchUpNotes: [
      "Age 7–12 years with no immunity evidence: 2 doses (3 months apart minimum)",
      "Age 13+: 2 doses (4–8 weeks apart; minimum 4 weeks)",
      "MMRV not recommended 12–47 months or 13–18 years"
    ]
  },
  HepA: {
    minimumAgeForDose1: "12 months",
    series: [
      { dose: 1, minimumAge: "12 months", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "18 months", minimumIntervalToPrev: "6 months after dose 1" }
    ],
    catchUpNotes: [
      "Age 6–11 months (travel): 1 dose before departure; not counted as part of 2-dose series; revaccinate at 12–23 months",
      "Anyone ≥2 years without prior vaccination may be vaccinated",
      "Unvaccinated persons ages 1–18 should be vaccinated as catch-up"
    ]
  },
  Tdap: {
    minimumAgeForDose1: "7 years",
    catchUpNotes: [
      "Ages 7–10: give Tdap if DTaP series incomplete; routine adolescent booster still due at 11–12 (unless Tdap given at age 10)",
      "Ages 11–18: 1 dose Tdap if not previously received",
      "If not fully vaccinated at ages 7–18: first catch-up dose should be Tdap; remaining doses may be Td or Tdap",
      "Wound management age 7+: Tdap/Td if >10 years for clean/minor wounds; >5 years for other wounds; Tdap preferred if not previously received"
    ]
  },
  HPV: {
    minimumAgeForDose1: "9 years",
    series: [
      { dose: 1, minimumAge: "9 years", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "9 years + 5 months", minimumIntervalToPrev: "Minimum 5 months after dose 1 (ages 9–14 at start = 2-dose series)" },
      { dose: 3, minimumAge: "9 years + 5 months", minimumIntervalToPrev: "Dose 3: 12 weeks after dose 2 AND 5 months after dose 1 (ages 15+ at start = 3-dose series)" }
    ],
    catchUpNotes: [
      "Routine ages 11–12; start as early as 9",
      "Catch-up through age 18 (routine); ages 19–26 shared clinical decision-making",
      "2-dose series if dose 1 given at ages 9–14 and NOT immunocompromised",
      "3-dose series if dose 1 given at ages 15+, or any age if immunocompromised",
      "If dose 2 given <5 months after dose 1: give dose 3 at least 12 weeks after dose 2",
      "Pregnancy: defer until after delivery; no testing required"
    ]
  },
  MenACWY: {
    minimumAgeForDose1: "2 months (high-risk) or 11 years (routine)",
    series: [
      { dose: 1, minimumAge: "11 years (routine)", minimumIntervalToPrev: "—" },
      { dose: 2, minimumAge: "16 years (booster)", minimumIntervalToPrev: "Minimum 8 weeks after dose 1" }
    ],
    catchUpNotes: [
      "Age 13–15 not yet vaccinated: 1 dose now; booster at 16–18 years (minimum 8 weeks after catch-up dose)",
      "Age 16–18 not yet vaccinated: 1 dose (no booster required)",
      "High-risk (asplenia, HIV, complement deficiency, travel): Menveo series starting at 2 months (4-dose series); MenQuadfi at ≥24 months",
      "College students/military recruits: 1 dose if not vaccinated at age 16+",
      "Penbraya (combined MenACWY-TT + MenB-FHbp): alternative when both vaccines indicated same visit, age 10+"
    ]
  },
  MenB: {
    minimumAgeForDose1: "10 years (high-risk); 16 years (shared decision-making)",
    catchUpNotes: [
      "Ages 16–23 not at increased risk: shared clinical decision-making; 2-dose series (Bexsero 0, ≥4 weeks OR Trumenba 0, ≥6 months)",
      "If Trumenba dose 2 given <6 months after dose 1: give dose 3 ≥4 months after dose 2",
      "At increased risk (asplenia, complement deficiency): 3-dose series (0, 1–2, 6 months); use same brand throughout",
      "Penbraya (MenACWY-TT/MenB-FHbp): if used as dose 1, complete with Trumenba"
    ]
  },
  Flu_IIV: {
    minimumAgeForDose1: "6 months",
    catchUpNotes: [
      "Ages 6 months–8 years: 2 doses (4 weeks apart) the first season they are vaccinated; 1 dose annually thereafter",
      "2 doses also needed if they received fewer than 2 doses before July 1 of the current year",
      "Age 9+: 1 dose annually",
      "LAIV4 (FluMist): approved age 2+; not recommended for immunocompromised, pregnancy, certain cardiac/pulmonary conditions",
      "Egg allergy: any age-appropriate flu vaccine acceptable"
    ]
  },
  COVID: {
    minimumAgeForDose1: "6 months",
    catchUpNotes: [
      "Annual updated COVID-19 vaccine recommended for everyone ≥6 months",
      "Shared clinical decision-making based on individual risk-benefit; especially favorable for high-risk individuals",
      "Follow current ACIP recommendations for number of doses based on prior vaccination history"
    ]
  },
  RSV_mAb: {
    minimumAgeForDose1: "Birth (seasonal)",
    catchUpNotes: [
      "Infants born Oct–Mar: 1 dose nirsevimab within 1 week of birth if mother unvaccinated or vaccinated <14 days before delivery",
      "Infants born Apr–Sep: 1 dose before RSV season start",
      "Ages 8–19 months at high risk (chronic lung disease, congenital heart disease, immunocompromised, American Indian/Alaska Native): 1 dose before second RSV season",
      "Infants who had cardiac surgery with bypass: 1 additional nirsevimab dose post-procedure"
    ]
  },
  Dengue: {
    minimumAgeForDose1: "9 years",
    catchUpNotes: [
      "3-dose series (0, 6, 12 months)",
      "Only for ages 9–16 in endemic areas with laboratory-confirmed prior dengue infection",
      "NOT for travelers to endemic areas without confirmed prior infection"
    ]
  }
};

// ─── ANTICIPATORY GUIDANCE TOPICS BY AGE GROUP ───────────────────────────────
const ANTICIPATORY_GUIDANCE = {
  prenatal: [
    "Benefits of breastfeeding and planned feeding method",
    "Safe sleep practices (back to sleep, firm flat surface, no soft bedding)",
    "Car safety seat installation and use",
    "Smoke-free home and car",
    "Social support and postpartum depression awareness",
    "Pediatric provider selection",
    "Newborn screening and immunizations overview",
    "Family planning"
  ],
  newborn_to_1mo: [
    "Breastfeeding support and technique",
    "Safe sleep: back-to-sleep, firm flat surface, room-sharing without bed-sharing",
    "Safe sleep environment: no loose bedding, bumpers, pillows",
    "Skin-to-skin contact, bonding",
    "Jaundice: signs and when to call",
    "Umbilical cord and circumcision care",
    "Normal newborn behaviors (feeding frequency, stooling patterns)",
    "Car safety seat: rear-facing, properly installed",
    "Smoke-free environment, avoid secondhand smoke",
    "Hand hygiene and infection prevention",
    "Temperature and illness: when to seek care for fever",
    "Postpartum depression screening of caregivers",
    "Developmental milestones",
    "Caregiver well-being and support network"
  ],
  "2mo_to_6mo": [
    "Continue breastfeeding (exclusive until 6 months)",
    "Introduction of solid foods around 6 months",
    "Safe sleep — ongoing reinforcement",
    "Tummy time when awake and supervised",
    "Developmental milestones and stimulation (talking, reading, singing)",
    "Car safety seat: rear-facing until at least age 2",
    "Vaccination schedule and fever management post-vaccines",
    "Secondhand smoke / nicotine exposure avoidance",
    "Sun protection: keep infants under 6 months out of direct sun",
    "Water safety — never leave baby unattended near water",
    "Oral health: wipe gums; first tooth — see dentist",
    "Screen time: avoid except video-chatting for children under 18–24 months",
    "Introducing allergens (peanut products) per AAP guidance"
  ],
  "9mo_to_18mo": [
    "Introduction of complementary foods; variety and texture progression",
    "Transition from bottle to cup by 12–15 months",
    "Limit juice; avoid sugar-sweetened beverages",
    "Oral health: begin brushing with fluoride toothpaste; dental home",
    "Safety: childproofing, stair gates, outlet covers, poison prevention",
    "Car safety seat: rear-facing until age 2 or maximum height/weight for seat",
    "Water safety",
    "Reading aloud, language development",
    "Limit screen time under 18–24 months (except video chat)",
    "Temperament and discipline: positive reinforcement, no spanking",
    "Sleep schedule: regular routines, self-soothing",
    "Developmental surveillance; autism screening at 18 months",
    "Caregiver mental health"
  ],
  "2y_to_5y": [
    "Healthy nutrition: MyPlate, limit saturated fat, sugar, salt",
    "Physical activity: at least 3 hours/day of active play",
    "Screen time: limit to 1 hour/day of high-quality programming for ages 2–5",
    "Consistent sleep routine; age-appropriate sleep needs",
    "Dental care: brushing twice daily with fluoride toothpaste; dentist visits",
    "Car safety seat progression: rear-facing → forward-facing with harness → booster",
    "Safety: helmet for bike/scooter, water safety, sunscreen",
    "Stranger safety and body autonomy",
    "Reading, language, and school readiness",
    "Social skills, emotional regulation, play",
    "Discipline: positive reinforcement, consistent limits, no spanking",
    "Firearm safety: if firearms in home, store unloaded and locked",
    "Tobacco, alcohol avoidance — model healthy behaviors"
  ],
  "6y_to_10y": [
    "Healthy nutrition and limiting ultra-processed foods",
    "60 minutes of moderate-to-vigorous physical activity daily",
    "Screen time limits; balance with sleep and activity",
    "Sleep: 9–12 hours for ages 6–12",
    "School performance, learning differences, bullying",
    "Peer relationships, social development",
    "Puberty education (early for ages 8–10)",
    "Body image and weight stigma avoidance",
    "Safety: bicycle helmets, sports safety equipment, water safety",
    "Online safety and media literacy",
    "Tobacco, alcohol, marijuana prevention",
    "Family communication, household rules",
    "Firearm safety"
  ],
  "11y_to_14y": [
    "Puberty: normal changes, hygiene, menstruation (if applicable)",
    "Healthy nutrition and body image",
    "Physical activity: 60 minutes daily",
    "Sleep: 8–10 hours for teenagers",
    "Mental health: stress, anxiety, depression — open communication",
    "Suicide and self-harm awareness; lethal means counseling",
    "Tobacco, alcohol, marijuana, vaping prevention (CRAFFT tool)",
    "Online safety, social media risks, cyberbullying",
    "Sexual development, consent, healthy relationships",
    "Confidentiality and adolescent privacy",
    "Driving safety (for approaching driving age)",
    "Firearm safety",
    "Vaccine-preventable diseases: HPV, meningitis",
    "College and career planning (older teens)"
  ],
  "15y_to_21y": [
    "Confidentiality and adolescent rights",
    "Sexual health: abstinence, contraception, STI prevention, consent",
    "HIV testing and PrEP awareness",
    "Mental health, depression, anxiety screening and resources",
    "Suicide risk and lethal means counseling",
    "Substance use: alcohol, tobacco, marijuana, opioids, other drugs (CRAFFT)",
    "Driving safety: distracted driving, seatbelts, alcohol/drug impairment",
    "Sleep: 8–10 hours (teens), 7–9 hours (young adults)",
    "Nutrition, body image, disordered eating awareness",
    "Physical activity: 60 min/day (teens), 150 min/week (adults)",
    "Transition to adult care planning",
    "Insurance and healthcare access",
    "Education/employment/relationships (HEADSS assessment)",
    "Firearm safety",
    "Violence prevention, healthy relationships, dating abuse",
    "Reproductive life planning",
    "Vaccine completion: HPV, meningococcal, annual flu, COVID"
  ]
};

// ─── AAP FOOTNOTES (verbatim from 2025 periodicity table) ────────────────────
const AAP_FOOTNOTES = {
  1:  "If a child comes under care for the first time at any point on the schedule, or if any items are not accomplished at the suggested age, the schedule should be brought up to date at the earliest possible time.",
  2:  "A prenatal visit is recommended for parents who are at high risk, for first-time parents, and for those who request a conference. The prenatal visit should include anticipatory guidance, pertinent medical history, and a discussion of benefits of breastfeeding and planned method of feeding.",
  3:  "Newborns should have an evaluation after birth, and breastfeeding should be encouraged (and instruction and support should be offered).",
  4:  "Newborns should have an evaluation within 3 to 5 days of birth and within 48 to 72 hours after discharge from the hospital to include evaluation for feeding and jaundice. Breastfeeding newborns should receive formal breastfeeding evaluation, and their mothers should receive encouragement and instruction. Newborns discharged less than 48 hours after delivery must be examined within 48 hours of discharge.",
  5:  "Screen per 'Clinical Practice Guideline for the Evaluation and Treatment of Children and Adolescents with Obesity' (https://doi.org/10.1542/peds.2022-060640).",
  6:  "Screening should occur per 'Clinical Practice Guideline for Screening and Management of High Blood Pressure in Children and Adolescents.' Blood pressure measurement in infants and children with specific risk conditions should be performed at visits before age 3 years.",
  7:  "A visual acuity screen is recommended at ages 4 and 5 years, as well as in cooperative 3-year-olds. Instrument-based screening may be used to assess risk at ages 12 and 24 months, in addition to the well visits at 3 through 5 years of age.",
  8:  "Confirm initial screen was completed, verify results, and follow up as appropriate. Newborns should be screened per 'Year 2007 Position Statement: Principles and Guidelines for Early Hearing Detection and Intervention Programs.'",
  9:  "Verify results as soon as possible, and follow up as appropriate.",
  10: "Screen with audiometry including 6,000 and 8,000 Hz high frequencies once between 11 and 14 years, once between 15 and 17 years, and once between 18 and 21 years.",
  11: "Screening should occur per 'Incorporating Recognition and Management of Perinatal Depression Into Pediatric Practice' — screen mother/caregiver at 1, 2, 4, and 6 month visits.",
  12: "Developmental screening using validated tool at 9, 18, and 30 month visits per 'Promoting Optimal Development: Identifying Infants and Young Children With Developmental Disorders Through Developmental Surveillance and Screening.'",
  13: "Autism spectrum disorder screening at 18 and 24 months per 'Identification, Evaluation, and Management of Children With Autism Spectrum Disorder.'",
  14: "Screen for behavioral and social-emotional problems per 'Promoting Optimal Development: Screening for Behavioral and Emotional Problems.' Screening should be family centered and may include asking about caregiver emotional and mental health concerns and social determinants of health, racism, poverty, and relational health.",
  15: "A recommended tool to assess use of alcohol, tobacco and nicotine, marijuana, and other substances, including opioids is the CRAFFT tool (http://crafft.org). If concern for opioid use, consider recommending/prescribing Naloxone.",
  16: "Screen adolescents for depression and suicide risk, making every effort to preserve confidentiality of the adolescent. See GLAD-PC guidelines.",
  17: "At each visit, age-appropriate physical examination is essential, with infant totally unclothed and older children undressed and suitably draped.",
  18: "These procedures may be modified, depending on entry point into schedule and individual need.",
  19: "Confirm initial newborn blood screen was accomplished, verify results, and follow up as appropriate. RUSP panel plus state newborn screening laws establish criteria.",
  20: "Verify newborn blood screen results as soon as possible, and follow up as appropriate.",
  21: "Confirm initial bilirubin screening was accomplished, verify results, and follow up. See 'Clinical Practice Guideline Revision: Management of Hyperbilirubinemia in the Newborn Infant 35 or More Weeks of Gestation.'",
  22: "Screening for critical congenital heart disease using pulse oximetry should be performed in newborns, after 24 hours of age, before discharge from the hospital.",
  23: "Schedules per the AAP Committee on Infectious Diseases are available at https://publications.aap.org/redbook/pages/immunization-schedules. Every visit should be an opportunity to update and complete a child's immunizations.",
  24: "Perform risk assessment or screening as appropriate per recommendations in the current edition of the AAP Pediatric Nutrition (Iron chapter).",
  25: "For children at risk of lead exposure, see 'Prevention of Childhood Lead Toxicity' and 'Low Level Lead Exposure Harms Children: A Renewed Call for Primary Prevention.'",
  26: "Perform risk assessments or screenings as appropriate, based on universal screening requirements for patients with Medicaid or in high prevalence areas.",
  27: "Tuberculosis testing per recommendations of the AAP Committee on Infectious Diseases, published in the current edition of the AAP Red Book. Testing should be performed on recognition of high-risk factors.",
  28: "See 'Integrated Guidelines for Cardiovascular Health and Risk Reduction in Children and Adolescents' (NHLBI). Universal fasting lipid screen at ages 9–11 years and 17–21 years.",
  29: "Adolescents should be screened for sexually transmitted infections per recommendations in the current edition of the AAP Red Book.",
  30: "Screen adolescents for HIV at least once between ages 15 and 21, making every effort to preserve confidentiality. After initial screening, youth at increased risk should be retested annually or more frequently.",
  31: "Perform a risk assessment for hepatitis B virus (HBV) infection per USPSTF recommendations.",
  32: "All individuals should be screened for hepatitis C virus (HCV) infection per USPSTF and CDC recommendations at least once between ages 18 and 79. Those at increased risk should be tested annually.",
  33: "Perform a risk assessment for sudden cardiac arrest/death per 'Sudden Death in the Young: Information for the Primary Care Provider.'",
  34: "See USPSTF recommendations for cervical cancer screening. Pap smear begins at age 21. Indications for pelvic examinations prior to age 21 noted in 'Gynecologic Examination for Adolescents in the Pediatric Office Setting.'",
  35: "Assess whether the child has a dental home. If no dental home identified, perform a risk assessment and refer. Recommend brushing with fluoride toothpaste in the proper dosage for age.",
  36: "Perform an oral health risk assessment at the 6- and 12-month visits.",
  37: "USPSTF recommends primary care clinicians apply fluoride varnish to the primary teeth of all infants and children starting at the age of primary tooth eruption. Apply every 3 to 6 months based on caries risk.",
  38: "If primary water source is deficient in fluoride, consider oral fluoride supplementation."
};

// ─── DYSLIPIDEMIA SCREENING SCHEDULE (AAP/NHLBI) ─────────────────────────────
const DYSLIPIDEMIA_SCHEDULE = {
  universal: [
    { ages: "9–11 years", type: "Universal fasting lipid panel" },
    { ages: "17–21 years", type: "Universal fasting lipid panel" }
  ],
  riskBased: "Ages 2–8 and 12–16: screen if family history of premature CVD, parental hypercholesterolemia, or patient has diabetes, hypertension, obesity, or tobacco use"
};

// ─── NEWBORN SCREENING PANEL REFERENCE ───────────────────────────────────────
const NEWBORN_SCREENING = {
  mandatoryComponents: [
    "Phenylketonuria (PKU)",
    "Congenital hypothyroidism",
    "Congenital adrenal hyperplasia (CAH)",
    "Galactosemia",
    "Biotinidase deficiency",
    "Maple syrup urine disease (MSUD)",
    "Homocystinuria",
    "Medium-chain acyl-CoA dehydrogenase deficiency (MCAD)",
    "Sickle cell disease and hemoglobinopathies",
    "Cystic fibrosis",
    "Critical congenital heart disease (CCHD) — pulse oximetry",
    "Hearing screening (UNHS)",
    "Severe combined immunodeficiency (SCID)",
    "Spinal muscular atrophy (SMA)",
    "And all conditions on the HRSA Recommended Uniform Screening Panel (RUSP)"
  ],
  notes: "Exact panel varies by state. For complete current list: https://www.hrsa.gov/advisory-committees/heritable-disorders/rusp/index.html and https://www.babysfirsttest.org/"
};

// ─── GROWTH VELOCITY & EXPECTED GAINS (AAP / WHO / Nelson Textbook) ─────────
// Sources: AAP Bright Futures, WHO Growth Standards, Nelson Textbook of Pediatrics
const GROWTH_REFERENCE = {
  newborn: {
    weight: "Expect 5-7% weight loss in first 3-5 days, regain birth weight by 10-14 days. Gain ~20-30 g/day (⅔–1 oz/day) in first month.",
    length: "Grow ~1.5 cm/week (~0.6 in/week) in first month.",
    headCirc: "Head circumference grows ~0.5 cm/week in first month.",
    feeding: [
      "Breastfeeding: 8-12 times per 24 hours on demand, both breasts each feeding",
      "Formula: 1-2 oz (30-60 mL) per feeding, 8-12 feedings/day in first week; increases to 2-3 oz per feeding by end of first month",
      "No water, juice, or other liquids",
      "Vitamin D supplementation: 400 IU/day starting in first few days of life for all breastfed and partially breastfed infants"
    ]
  },
  "1mo": {
    weight: "Gain ~20-30 g/day (⅔–1 oz/day). Should double birth weight by 4-5 months.",
    length: "Grow ~3-4 cm/month (~1.2-1.6 in/month).",
    headCirc: "Head circumference grows ~1.5-2 cm/month.",
    feeding: [
      "Breastfeeding: 8-12 times per 24 hours, ~15-20 min per breast",
      "Formula: 3-4 oz (90-120 mL) per feeding every 3-4 hours",
      "No water, juice, cereal in bottle, or solids",
      "Continue Vitamin D 400 IU/day if breastfed"
    ]
  },
  "2mo": {
    weight: "Gain ~20-30 g/day. Average ~5-6 kg (~11-13 lb) by 2 months.",
    length: "Grow ~3-4 cm/month.",
    headCirc: "Head circumference grows ~1.5-2 cm/month.",
    feeding: [
      "Breastfeeding: 6-10 times per 24 hours, may begin longer stretches at night",
      "Formula: 4-5 oz (120-150 mL) per feeding, 6-8 feedings/day (~24-32 oz/day total)",
      "No water, juice, or solids yet — exclusive breast milk or formula until 6 months",
      "Continue Vitamin D 400 IU/day if breastfed"
    ]
  },
  "4mo": {
    weight: "Gain ~15-20 g/day. Should double birth weight around 4-5 months.",
    length: "Grow ~2-3 cm/month (~1 in/month).",
    headCirc: "Head circumference grows ~1 cm/month.",
    feeding: [
      "Breastfeeding: 5-8 times per 24 hours",
      "Formula: 5-6 oz (150-180 mL) per feeding, 5-6 feedings/day (~28-36 oz/day total)",
      "May introduce pureed single-ingredient foods (iron-fortified cereals, pureed vegetables, fruits) at 4-6 months if showing readiness signs",
      "Signs of readiness: good head control, sitting with support, showing interest in food, loss of tongue-thrust reflex",
      "Early allergen introduction (peanut protein) recommended at 4-6 months for high-risk infants (per AAP/NIAID guidelines)",
      "No juice, honey, or cow's milk"
    ]
  },
  "6mo": {
    weight: "Gain ~10-15 g/day. Should double birth weight by now; will triple by 12 months.",
    length: "Grow ~1.5-2.5 cm/month. Average length increases ~50% from birth by 12 months.",
    headCirc: "Head circumference grows ~0.5-1 cm/month.",
    feeding: [
      "Begin complementary foods (pureed/mashed): iron-fortified cereals, vegetables, fruits, meats",
      "Introduce variety of textures and flavors — one new food every 3-5 days to watch for allergies",
      "Early allergen introduction: peanut, egg, dairy, wheat, soy, fish — per AAP guidelines to reduce allergy risk",
      "Breastfeeding: continue on demand, 4-6 times/day alongside solids",
      "Formula: 24-32 oz/day total, may decrease as solids increase",
      "May offer sips of water from open or straw cup with meals (2-4 oz/day)",
      "No juice before 12 months (AAP recommendation), no honey, no cow's milk as main drink"
    ]
  },
  "9mo": {
    weight: "Gain ~10-13 g/day.",
    length: "Grow ~1.5 cm/month.",
    headCirc: "Head circumference grows ~0.5 cm/month.",
    feeding: [
      "3 meals of soft table foods + 1-2 snacks/day; finger foods encouraged (soft pieces, dissolvable puffs)",
      "Breastfeeding or formula: continue 3-5 times/day (~24-30 oz formula/day)",
      "Encourage self-feeding and cup drinking",
      "No juice before 12 months, no honey, no cow's milk as drink",
      "Iron-rich foods important: fortified cereals, meats, beans"
    ]
  },
  "12mo": {
    weight: "Should have tripled birth weight (~10 kg / 22 lb average). Gain ~200-250 g/month (~7-8 oz/month) in second year.",
    length: "Average 75 cm (29.5 in). Grow ~1 cm/month (~0.5 in/month) in second year.",
    headCirc: "Head circumference grows ~0.25-0.5 cm/month.",
    feeding: [
      "Transition to whole cow's milk: 16-24 oz/day (no more than 24 oz to prevent iron deficiency anemia)",
      "Wean from bottle by 12-15 months — use open cup or straw cup",
      "3 meals + 2 snacks/day of table foods, chopped/small pieces",
      "May introduce 100% fruit juice: max 4 oz/day (AAP), offer only with meals in a cup, not a bottle",
      "Honey now safe (after age 1)",
      "Avoid choking hazards: whole grapes, hot dogs, nuts, raw carrots, popcorn, hard candy",
      "Continue Vitamin D 600 IU/day if <16 oz whole milk/day"
    ]
  },
  "15mo": {
    weight: "Gain ~200-250 g/month. Average ~11 kg (24 lb).",
    length: "Grow ~1 cm/month.",
    feeding: [
      "Whole cow's milk 16-24 oz/day; no more than 24 oz",
      "3 meals + 2 snacks/day; family foods with appropriate modifications",
      "100% juice max 4 oz/day with meals only",
      "May be a picky eater — continue offering variety without pressure",
      "Wean completely from bottle if not yet done"
    ]
  },
  "18mo": {
    weight: "Gain ~200 g/month. Average ~11-12 kg (24-26 lb).",
    length: "Grow ~1 cm/month. Average ~82 cm (32 in).",
    feeding: [
      "Whole cow's milk 16-24 oz/day (switch to low-fat/skim at age 2 per AAP if no concerns)",
      "3 meals + 2 snacks/day; continue offering diverse foods",
      "100% juice max 4 oz/day with meals",
      "Self-feeding with utensils encouraged; expect messiness",
      "Limit added sugars and sodium; avoid sugar-sweetened beverages"
    ]
  },
  "24mo": {
    weight: "Average ~12-13 kg (26-29 lb). Should have quadrupled birth weight. Gain ~2-2.5 kg/year through early childhood.",
    length: "Average ~86-87 cm (34 in). Grow ~7-8 cm/year (~3 in/year) ages 2-5.",
    bmiClassification: true,
    feeding: [
      "Transition to low-fat (1%) or skim milk per family preference/growth; 16-20 oz/day",
      "3 meals + 2 snacks/day; follow MyPlate guidelines",
      "100% juice max 4 oz/day",
      "Limit added sugars to <25 g/day; avoid sugar-sweetened beverages",
      "Serve age-appropriate portions: ~1 tablespoon per year of age per food group",
      "Family meals together when possible — positive mealtime environment"
    ]
  },
  "30mo": {
    weight: "Gain ~2-2.5 kg/year (~4.5-5.5 lb/year).",
    length: "Grow ~7-8 cm/year (~3 in/year).",
    bmiClassification: true,
    feeding: [
      "Low-fat or skim milk ~16-20 oz/day",
      "MyPlate: fruits, vegetables, grains, protein, dairy at each meal",
      "100% juice max 4-6 oz/day (ages 1-3: max 4 oz; ages 4-6: max 6 oz)",
      "Limit ultra-processed foods, fast food, and sugary snacks"
    ]
  },
  "3y": {
    weight: "Average ~14-15 kg (31-33 lb). Gain ~2 kg/year.",
    length: "Average ~95 cm (37 in). Grow ~6-7 cm/year (~2.5 in/year).",
    bmiClassification: true,
    feeding: [
      "Low-fat milk; total dairy ~2 cups/day",
      "MyPlate portions; ~1,000-1,400 calories/day",
      "100% juice max 4 oz/day",
      "Encourage water as primary beverage",
      "Limit added sugars <25 g/day"
    ]
  },
  "4y": {
    weight: "Gain ~2-2.5 kg/year. Average ~16-17 kg (35-37 lb).",
    length: "Grow ~6-7 cm/year. Average ~102 cm (40 in).",
    bmiClassification: true,
    feeding: [
      "~1,200-1,600 calories/day depending on activity",
      "100% juice max 4-6 oz/day",
      "Fat-free or low-fat milk and dairy products",
      "Encourage 5+ servings of fruits/vegetables daily",
      "Limit screen time during meals; promote family meals"
    ]
  },
  "5y": {
    weight: "Gain ~2-2.5 kg/year. Average ~18-20 kg (40-44 lb).",
    length: "Grow ~5-7 cm/year. Average ~109 cm (43 in).",
    bmiClassification: true,
    feeding: [
      "~1,200-1,800 calories/day depending on activity",
      "100% juice max 4-6 oz/day (age 4-6: max 6 oz)",
      "Encourage independence in food choices from healthy options",
      "Model healthy eating behaviors"
    ]
  },
  "6y_to_10y": {
    weight: "Gain ~2-3 kg/year (4.5-6.5 lb/year) until puberty. Preadolescent weight gain may accelerate.",
    length: "Grow ~5-6 cm/year (~2-2.5 in/year) until puberty.",
    bmiClassification: true,
    feeding: [
      "~1,400-2,200 calories/day based on age, gender, and activity level",
      "100% juice max 8 oz/day (ages 7+)",
      "Water and low-fat milk as primary beverages",
      "Encourage whole grains, lean protein, fruits, vegetables",
      "Limit sugar-sweetened beverages, fast food, and ultra-processed snacks",
      "Teach nutrition label reading"
    ]
  },
  "11y_to_14y": {
    weight: "Puberty weight gain: Girls ~7-25 kg total over puberty (peak ~8-9 kg/year). Boys ~7-30 kg total (peak ~9 kg/year, typically 1-2 years after girls).",
    length: "Puberty growth spurt: Girls ~8-14 cm/year (peak ~11-12 years, ~2 years after breast development). Boys ~10-14 cm/year (peak ~13-14 years). Girls typically complete growth ~2 years after menarche; boys by ~17-18 years.",
    bmiClassification: true,
    feeding: [
      "~1,800-3,200 calories/day depending on gender, pubertal stage, and activity",
      "Calcium: 1,300 mg/day (critical for peak bone mass during puberty)",
      "Iron: 8-15 mg/day (increased need in menstruating adolescents)",
      "Healthy body image counseling — avoid restrictive dieting",
      "Screen for disordered eating behaviors",
      "Limit sugar-sweetened beverages and energy drinks",
      "No caffeine >100 mg/day for ages 12-18"
    ]
  },
  "15y_to_21y": {
    weight: "Late pubertal changes; growth velocity slowing. Most girls have reached adult weight; boys may gain until 18-21.",
    length: "Girls: most have reached adult height by 15-16. Boys: may grow until 18-21. Final height typically within 2 inches of mid-parental height.",
    bmiClassification: true,
    feeding: [
      "~2,000-3,200 calories/day based on activity level",
      "Calcium: 1,300 mg/day through age 18, then 1,000 mg/day",
      "Iron: 11 mg/day (males), 15 mg/day (females, menstruating)",
      "Healthy relationship with food; screen for eating disorders (SCOFF tool)",
      "Vegetarian/vegan diets need B12, iron, zinc, calcium supplementation assessment",
      "Avoid energy drinks; limit caffeine to <100 mg/day (12-18) or <400 mg/day (18+)",
      "Promote meal planning and cooking skills for independence"
    ]
  }
};

// ─── REFLEXES (AAP Bright Futures / Nelson Textbook of Pediatrics) ──────────
// Primitive reflexes are brainstem-mediated. Their presence at the expected
// age confirms intact CNS function; their timely disappearance reflects
// normal cortical maturation. Persistence, asymmetry, or re-emergence is a
// red flag for neurologic evaluation.
const REFLEXES_REFERENCE = {
  newborn: {
    intro: "All primitive reflexes should be present, symmetric, and easily elicited. Absent or markedly asymmetric responses suggest brachial plexus injury, stroke, hypotonia, or other CNS pathology.",
    reflexes: [
      { name: "Rooting",         status: "Present",  note: "Stroking the cheek turns the head toward the touch and opens the mouth. Aids latch. Fades 3–4 mo." },
      { name: "Sucking",         status: "Present",  note: "Anything placed in the mouth triggers rhythmic sucking. Becomes voluntary by ~4 mo." },
      { name: "Moro (startle)",  status: "Present",  note: "Sudden head drop or loud noise → symmetric arm extension then flexion, often with a cry. Asymmetry = brachial plexus injury / clavicle fracture / hemiparesis. Fades 4–6 mo." },
      { name: "Palmar grasp",    status: "Present",  note: "Pressure on the palm closes the fingers. Fades 4–6 mo; persistence interferes with voluntary reach." },
      { name: "Plantar grasp",   status: "Present",  note: "Pressure at the ball of the foot curls the toes down. Fades 9–12 mo." },
      { name: "Stepping",        status: "Present",  note: "Held upright with feet on a surface → reciprocal stepping movements. Fades by ~2 mo." },
      { name: "Galant",          status: "Present",  note: "Stroking paravertebrally on one side → trunk curves toward the stroked side. Fades 4–6 mo." },
      { name: "Tonic neck (fencing)", status: "Emerging", note: "Head turned to one side → arm/leg extend on that side, flex on the opposite. Becomes most prominent at 1–2 mo, fades by 4–6 mo. An obligate, fixed response is abnormal." },
      { name: "Tongue protrusion (tongue thrust)", status: "Present", note: "Touch to the lips/tongue or a solid in the mouth causes the tongue to push forward. Protects from choking before swallowing is mature; its disappearance at 4–6 mo is the key signal that purees can begin. Persistence in older kids causes dental open bite, lisps, and messy eating." },
      { name: "Babinski",        status: "Up-going (normal)", note: "Stroking the lateral sole → big toe dorsiflexes, toes fan. Normal up to ~12–24 mo. A positive Babinski after age 2 is an upper-motor-neuron sign." }
    ]
  },
  "1mo": {
    intro: "All primitive reflexes remain fully present and symmetric.",
    reflexes: [
      { name: "Rooting / Sucking", status: "Present",  note: "Strong and reliable; feeding should be well-coordinated." },
      { name: "Moro",              status: "Present",  note: "Full symmetric response. Asymmetry still warrants eval (brachial plexus, clavicle fracture, hemiparesis)." },
      { name: "Palmar / Plantar grasp", status: "Present", note: "Strong; the baby may lift slightly off the surface when pulling up on your fingers." },
      { name: "Tonic neck",        status: "Present",  note: "Becoming more visible; should not be obligate." },
      { name: "Galant, Stepping",  status: "Present",  note: "Still easily elicited." },
      { name: "Tongue thrust",     status: "Present",  note: "Still fully present — do not start solids." },
      { name: "Babinski",          status: "Up-going (normal)", note: "Normal at this age." }
    ]
  },
  "2mo": {
    intro: "Primitive reflexes still strong; social smile and visual tracking emerging alongside.",
    reflexes: [
      { name: "Moro",           status: "Present",  note: "Still easily triggered. Should peak around this age then begin to wane." },
      { name: "Tonic neck",     status: "Peak",     note: "Most visible at 1–2 mo. Should not be obligate or prolonged." },
      { name: "Rooting / Sucking / Palmar / Plantar", status: "Present", note: "All remain strong." },
      { name: "Stepping",       status: "Fading",   note: "Typically gone by 2 mo." },
      { name: "Tongue thrust",  status: "Present",  note: "Solids still contraindicated." },
      { name: "Babinski",       status: "Up-going (normal)", note: "Normal at this age." }
    ]
  },
  "4mo": {
    intro: "Transition visit — primitive reflexes are beginning to integrate as cortical control takes over. Readiness for solids depends partly on loss of the tongue-thrust reflex.",
    reflexes: [
      { name: "Moro",            status: "Fading",    note: "Noticeably weaker than at 2 mo. Persistence past 6 mo is abnormal." },
      { name: "Rooting",         status: "Fading",    note: "Becoming voluntary." },
      { name: "Palmar grasp",    status: "Fading",    note: "Weaker; voluntary release begins." },
      { name: "Tonic neck",      status: "Fading",    note: "Should be diminishing; obligate response is abnormal." },
      { name: "Galant, Stepping", status: "Absent",   note: "Should be gone by now." },
      { name: "Tongue thrust",   status: "Fading / Gone", note: "Disappearance (4–6 mo) is the readiness sign for pureed solids. If a spoon still gets pushed out, wait." },
      { name: "Landau",          status: "Emerging",  note: "Held prone in the air, baby extends head, spine, and legs. Integrates by 1–2 y." },
      { name: "Babinski",        status: "Up-going (normal)", note: "Normal at this age." }
    ]
  },
  "6mo": {
    intro: "Most primitive reflexes should now be integrated. Protective (parachute) reflexes begin emerging — these persist for life.",
    reflexes: [
      { name: "Moro, Rooting, Tonic neck, Galant", status: "Absent / Integrated", note: "Persistence at 6 mo warrants neurologic evaluation." },
      { name: "Tongue thrust",   status: "Absent",   note: "Should be gone — prerequisite for safe spoon-feeding of solids." },
      { name: "Palmar grasp",    status: "Integrated", note: "Replaced by voluntary raking grasp." },
      { name: "Plantar grasp",   status: "Present",  note: "Still present; fades 9–12 mo." },
      { name: "Parachute",       status: "Emerging (6–9 mo)", note: "Held prone and tilted head-down, arms extend protectively. Persists for life — absence is concerning." },
      { name: "Landau",          status: "Present",  note: "Full response by ~6 mo." },
      { name: "Babinski",        status: "Up-going (normal)", note: "Normal at this age." }
    ]
  },
  "9mo": {
    intro: "Primitive reflexes should be absent. Protective reflexes present and reliable.",
    reflexes: [
      { name: "All primitive reflexes (Moro, grasp, rooting, tonic neck, Galant)", status: "Absent", note: "Persistence is a red flag for CP, hypoxic injury, or genetic/metabolic disease." },
      { name: "Plantar grasp",   status: "Fading",   note: "Usually gone by 9–12 mo — allows independent standing." },
      { name: "Parachute",       status: "Present",  note: "Should be fully present and symmetric." },
      { name: "Protective extension (sideways)", status: "Present", note: "Arm extends to catch self when tipped — needed for safe sitting." },
      { name: "Babinski",        status: "Up-going (may still be normal)", note: "Still acceptable; expect resolution by ~2 y." }
    ]
  },
  "12mo": {
    intro: "Protective and postural reflexes drive standing and cruising. Any lingering primitive reflex is abnormal.",
    reflexes: [
      { name: "Primitive reflexes", status: "Absent", note: "Residual Moro, grasp, or tonic neck at 1 y warrants neurologic eval." },
      { name: "Plantar grasp",      status: "Absent", note: "Should be gone — needed for weight-bearing and first steps." },
      { name: "Parachute",          status: "Present (lifelong)", note: "Symmetric protective arm extension." },
      { name: "Protective extension (forward/sideways/backward)", status: "Present", note: "All directions present by ~12 mo; essential for safe walking." },
      { name: "Babinski",           status: "Up-going still acceptable", note: "Normal until ~2 y. Asymmetry is always abnormal." }
    ]
  },
  "15mo": {
    intro: "Postural reflexes mature alongside walking.",
    reflexes: [
      { name: "Primitive reflexes", status: "Absent", note: "Any re-emergence or persistence warrants evaluation." },
      { name: "Parachute / Protective extension", status: "Present", note: "Symmetric in all directions." },
      { name: "Babinski", status: "Up-going still acceptable", note: "Transitioning toward down-going over the next 6–12 mo." },
      { name: "Deep tendon reflexes (patellar, biceps, Achilles)", status: "Present (2+)", note: "Become easier to elicit as tone normalizes. Symmetric and brisk but not clonic." }
    ]
  },
  "18mo": {
    intro: "Near-adult reflex pattern; Babinski response nearing transition.",
    reflexes: [
      { name: "Primitive reflexes", status: "Absent", note: "Persistence is abnormal." },
      { name: "Parachute / Protective extension", status: "Present", note: "Fully developed." },
      { name: "Babinski", status: "Transitioning", note: "May still be up-going but should be down-going (normal plantar flexion) by age 2." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Biceps, patellar, Achilles. Asymmetry suggests cord, root, or peripheral nerve pathology." }
    ]
  },
  "24mo": {
    intro: "Adult-pattern reflex exam expected from age 2.",
    reflexes: [
      { name: "Babinski (plantar response)", status: "Down-going (normal)", note: "After age 2, an up-going toe is an upper-motor-neuron sign (stroke, CP, spinal cord lesion, demyelination)." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Biceps, triceps, brachioradialis, patellar, Achilles. Hyperreflexia or clonus → UMN lesion; hyporeflexia → LMN / neuropathy / myopathy." },
      { name: "Parachute / Protective extension", status: "Present (lifelong)", note: "Absence would be abnormal." },
      { name: "Primitive reflexes", status: "Absent", note: "Any re-emergence is abnormal." }
    ]
  },
  "30mo": {
    intro: "Adult-pattern exam.",
    reflexes: [
      { name: "Plantar response",     status: "Down-going", note: "Up-going Babinski after age 2 is abnormal." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Biceps, patellar, Achilles. Asymmetry, clonus, or hyperreflexia warrants workup." },
      { name: "Protective / postural reflexes", status: "Present", note: "Intact balance reactions support running, climbing, jumping." }
    ]
  },
  "3y_to_5y": {
    intro: "Standard adult-pattern neurologic reflex exam.",
    reflexes: [
      { name: "Plantar response",     status: "Down-going", note: "Positive Babinski is always abnormal at this age." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Biceps, triceps, brachioradialis, patellar, Achilles. Grade 0–4; asymmetry is the most clinically meaningful finding." },
      { name: "Gait-related reflexes", status: "Intact", note: "Smooth tandem walk, heel-toe, hopping on one foot by age 4–5 — integrate cerebellar and corticospinal function." }
    ]
  },
  "6y_to_10y": {
    intro: "Focused adult-pattern exam — any primitive reflex (snout, grasp, glabellar) re-emerging is a frontal release sign and abnormal.",
    reflexes: [
      { name: "Plantar response",     status: "Down-going", note: "Up-going = UMN lesion." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Screen for asymmetry, hyperreflexia (MS, cord lesion), or loss (neuropathy, myopathy — e.g., Duchenne's). Loss of Achilles reflex can be an early sign of Charcot-Marie-Tooth." },
      { name: "Abdominal reflexes",   status: "Present",    note: "Stroking each quadrant contracts the umbilicus toward it. Loss is an early clue to UMN/cord pathology or scoliosis with cord involvement." },
      { name: "Cremasteric reflex (males)", status: "Present", note: "Stroking medial thigh elevates the ipsilateral testis. Absent in testicular torsion." }
    ]
  },
  "11y_to_14y": {
    intro: "Adult neurologic exam. Sports-participation exams should include a reflex screen.",
    reflexes: [
      { name: "Plantar response",     status: "Down-going", note: "Up-going is always abnormal." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Hyperreflexia/clonus in a teen → think MS, myelopathy, spinal cord tumor, B12 deficiency. Hyporeflexia → Guillain-Barré, neuropathy, hypothyroidism." },
      { name: "Abdominal / cremasteric", status: "Present", note: "Same significance as in younger children." }
    ]
  },
  "15y_to_21y": {
    intro: "Full adult neurologic exam.",
    reflexes: [
      { name: "Plantar response",     status: "Down-going", note: "Positive Babinski = UMN lesion (stroke, MS, cord pathology)." },
      { name: "Deep tendon reflexes", status: "2+ symmetric", note: "Include biceps, triceps, brachioradialis, patellar, Achilles. Asymmetry or pathologic spread is the main flag." },
      { name: "Primitive / frontal release signs (grasp, snout, palmomental, glabellar)", status: "Absent", note: "Presence suggests frontal lobe pathology, neurodegenerative disease, or severe TBI — rare but important in post-concussion / substance-use contexts." }
    ]
  }
};

// ─── BMI / WEIGHT CLASSIFICATION (AAP 2023 CPG + CDC Extended BMI) ──────────
// Source: AAP Clinical Practice Guideline for Evaluation and Treatment of
// Children and Adolescents with Obesity (Pediatrics 2023;151(2):e2022060640)
// CDC Extended BMI-for-Age Percentiles (Pediatrics 2023;152(3):e2023062285)
const BMI_CLASSIFICATION = {
  appliesAge: "Ages 2-20 years (use weight-for-length <2 years)",
  categories: [
    { label: "Underweight",              range: "BMI < 5th percentile",                     color: "#60a5fa", action: "Evaluate for nutritional deficiency, chronic illness, or eating disorder" },
    { label: "Healthy Weight",           range: "BMI 5th to < 85th percentile",             color: "#34d399", action: "Reinforce healthy habits" },
    { label: "Overweight",               range: "BMI 85th to < 95th percentile",            color: "#fbbf24", action: "Motivational interviewing, dietary counseling, activity assessment" },
    { label: "Obesity (Class I)",        range: "BMI ≥ 95th percentile but < 120% of 95th", color: "#fb923c", action: "Intensive health behavior and lifestyle treatment (IHBLT); comorbidity screening: fasting glucose/HbA1c, lipid panel, ALT, BP" },
    { label: "Severe Obesity (Class II)", range: "BMI ≥ 120% to < 140% of 95th percentile (or BMI ≥ 35)", color: "#f87171", action: "IHBLT; consider pharmacotherapy (≥12 years); comorbidity screening; sleep study if symptomatic; assess psychosocial impact" },
    { label: "Severe Obesity (Class III)",range: "BMI ≥ 140% of 95th percentile (or BMI ≥ 40)", color: "#dc2626", action: "IHBLT; consider pharmacotherapy (≥12y) and metabolic/bariatric surgery (≥13y); comprehensive comorbidity evaluation; behavioral health" }
  ],
  underTwo: "For children < 2 years: use WHO weight-for-length chart. Weight-for-length ≥ 97.7th percentile indicates high weight status. No BMI classification for under 2.",
  comorbidityScreening: [
    "Fasting glucose or HbA1c (for type 2 diabetes risk — screen starting at age 10 or puberty onset if BMI ≥85th %ile)",
    "Fasting lipid panel",
    "ALT (for nonalcoholic fatty liver disease — screen starting at age 9-11 if BMI ≥85th %ile)",
    "Blood pressure at every visit",
    "Polysomnography if symptoms of obstructive sleep apnea",
    "Mental health screening (depression, anxiety, bullying, stigma)"
  ],
  notes: "Use CDC Extended BMI-for-Age growth charts for children with BMI >97th percentile to better track changes over time. The 98th percentile on extended charts approximates 120% of the 95th percentile in older children/adolescents."
};

// ─── EXPORTS ──────────────────────────────────────────────────────────────────
if (typeof module !== "undefined" && module.exports) {
  module.exports = {
    VISIT_AGES,
    WELL_VISIT_CODES,
    VACCINES,
    PERIODICITY,
    CATCH_UP_SCHEDULE,
    ANTICIPATORY_GUIDANCE,
    AAP_FOOTNOTES,
    DYSLIPIDEMIA_SCHEDULE,
    NEWBORN_SCREENING,
    GROWTH_REFERENCE,
    REFLEXES_REFERENCE,
    BMI_CLASSIFICATION,
  };
}
