/* ================================================================
   FINANCE_TAXONOMY — single source of truth for the whole edition.
   Consumed by LaneHub, Subcat, CategoryHub, Footer, seed scripts,
   and iris-realtime URL parsing.

   Structure:  lane → category[14] → topic[4] → guide[5]
   Total:      2 × 14 × 4 × 5 = 560 English guides
   × 8 langs = 4,480 pages at full fanout

   Slug rules:
   - category: one-word or hyphenated ("foundations","life-events")
   - topic:    kebab-case, ampersands dropped ("budgeting-cash-flow")
   - guide:    title slugified, "How to " prefix stripped

   Contributor flags:
   - author: "Johnnie" | "Isabella"   — shows that byline on the guide
   - status: "built"                  — already shipped, live URL
   - status: "drafting"               — Sam writing now, not yet live
   - (no author/status)               — Iris will build on demand
   ================================================================ */

const FINANCE_TAXONOMY = {
  personal: {
    label: "Personal",
    tagline: "Your money, without the jargon.",
    categories: [
      { slug: "foundations", name: "Foundations", tagline: "The quiet work. Before everything else.", topics: [
        { slug: "budgeting-cash-flow", name: "Budgeting & Cash Flow", guides: [
          { title: "How to Build a Budget You'll Actually Follow" },
          { title: "How to Track Monthly Cash Flow Without an App" },
          { title: "How to Use the 50/30/20 Rule Without Making It a Religion" },
          { title: "How to Set Financial Goals in Dollar Figures (Not Feelings)" },
          { title: "How to Build a Zero-Based Budget in One Evening" },
        ]},
        { slug: "emergency-savings", name: "Emergency Savings", guides: [
          { title: "How to Build a 3-Month Emergency Fund", slug: "build-a-3-month-emergency-fund", author: "Johnnie", status: "built" },
          { title: "How to Calculate Your Real Essential Spend" },
          { title: "How to Decide Between Building Savings and Paying Down Debt First" },
          { title: "How to Know When Your Emergency Fund Is Big Enough" },
          { title: "How to Rebuild an Emergency Fund After You Drained It" },
        ]},
        { slug: "net-worth-tracking", name: "Net Worth & Tracking", guides: [
          { title: "How to Calculate Your Real Net Worth (Assets, Not Vibes)" },
          { title: "How to Run a 15-Minute Quarterly Money Review", slug: "run-a-15-minute-quarterly-money-review", author: "Johnnie", status: "built" },
          { title: "How to Read a Bank Statement Like It's a Map" },
          { title: "How to Track Net Worth Over Time Without Spreadsheet Hell" },
          { title: "How to Benchmark Your Net Worth Against Your Age" },
        ]},
        { slug: "money-mindset", name: "Money Mindset", guides: [
          { title: "How to Stop Avoiding Your Bank Balance" },
          { title: "How to Have a Money Conversation With Your Partner" },
          { title: "How to Decide What Enough Looks Like for You" },
          { title: "How to Recover From a Financial Mistake Without Spiraling" },
          { title: "How to Build the Habit of Checking Money Weekly" },
        ]},
      ]},

      { slug: "banking", name: "Banking", tagline: "Where money sits and how it moves.", topics: [
        { slug: "account-types", name: "Account Types", guides: [
          { title: "How to Choose a Checking Account in 2026" },
          { title: "How to Pick Your First HYSA Without Going Down a Rabbit Hole", slug: "pick-your-first-hysa-without-going-down-a-rabbit-hole", author: "Johnnie", status: "built" },
          { title: "How to Pair a HYSA With Your Main Bank" },
          { title: "How to Know If You Need a Money Market Account" },
          { title: "How to Choose Between a Credit Union and a Big Bank" },
        ]},
        { slug: "fees-features", name: "Fees & Features", guides: [
          { title: "How to Avoid Every Common Bank Fee" },
          { title: "How to Know If Your Bank Is Ripping You Off" },
          { title: "How to Negotiate Fees With Your Bank" },
          { title: "How to Decide If You Actually Need Premium Checking" },
          { title: "How to Read Your Bank's Fee Schedule in Under 10 Minutes" },
        ]},
        { slug: "digital-banking", name: "Digital Banking", guides: [
          { title: "How to Set Up Zelle, Venmo, and Cash App Safely" },
          { title: "How to Use Multiple Bank Accounts Without Losing Your Mind" },
          { title: "How to Automate Transfers Between Accounts" },
          { title: "How to Use a Fintech Bank Without Getting Burned" },
          { title: "How to Recover Access to a Locked Account" },
        ]},
        { slug: "safety-disputes", name: "Safety & Disputes", guides: [
          { title: "How to Dispute a Fraudulent Charge and Win" },
          { title: "How to Recognize a Bank Phishing Scam" },
          { title: "How to File an FDIC Claim If Your Bank Fails" },
          { title: "How to Protect a Joint Account in a Divorce" },
          { title: "How to Close an Account Without Breaking Your Auto-Pays" },
        ]},
      ]},

      { slug: "savings", name: "Savings", tagline: "Short-term goals, sinking funds, CDs.", topics: [
        { slug: "saving-for-goals", name: "Saving for Goals", guides: [
          { title: "How to Save for a Wedding Without Going Broke" },
          { title: "How to Save for a Car in Cash" },
          { title: "How to Save for a Big Trip in 12 Months" },
          { title: "How to Save for a Home Down Payment" },
          { title: "How to Save for Holiday Spending All Year" },
        ]},
        { slug: "sinking-funds", name: "Sinking Funds", guides: [
          { title: "How to Build a Sinking Fund for Irregular Bills" },
          { title: "How to Use Sinking Funds for Car Maintenance" },
          { title: "How to Set Up Sinking Funds for Insurance Premiums" },
          { title: "How to Structure Sinking Funds for Pet Emergencies" },
          { title: "How to Automate Sinking Fund Transfers" },
        ]},
        { slug: "rates-yield", name: "Rates & Yield", guides: [
          { title: "How to Compare HYSA Rates Without Falling for Teaser APYs" },
          { title: "How to Know When to Move Your Savings Between Banks" },
          { title: "How to Ladder Your Savings Across Multiple Rates" },
          { title: "How to Decide Between Promo Rate and Boring Rate" },
          { title: "How to Lock In a High Rate Before the Fed Cuts" },
        ]},
        { slug: "cds-treasuries", name: "CDs & Treasuries", guides: [
          { title: "How to Build a CD Ladder" },
          { title: "How to Buy Treasury Bills Through TreasuryDirect" },
          { title: "How to Decide Between a CD and a HYSA" },
          { title: "How to Know If Brokered CDs Are Worth It" },
          { title: "How to Choose Between I-Bonds and T-Bills" },
        ]},
      ]},

      { slug: "income", name: "Income", tagline: "Earning more, keeping more.", topics: [
        { slug: "salary-negotiation", name: "Salary & Negotiation", guides: [
          { title: "How to Negotiate a Salary Increase With Real Numbers" },
          { title: "How to Negotiate Your First Job Offer" },
          { title: "How to Negotiate a Counter-Offer Without Burning Bridges" },
          { title: "How to Research Market Rates for Your Role" },
          { title: "How to Ask for a Raise in a Bad Year" },
        ]},
        { slug: "paycheck-benefits", name: "Paycheck & Benefits", guides: [
          { title: "How to Read Your Paystub and Catch Errors" },
          { title: "How to Fill Out a W-4 That Matches Your Actual Tax Situation" },
          { title: "How to Evaluate a Benefits Package Beyond Base Salary" },
          { title: "How to Optimize Your HSA Contribution" },
          { title: "How to Decide Between PPO and HDHP" },
        ]},
        { slug: "side-income", name: "Side Income", guides: [
          { title: "How to Start a Side Hustle That Makes Real Money" },
          { title: "How to Handle Taxes on 1099 Side Income" },
          { title: "How to Turn a Hobby Into Taxable Income and When Not To" },
          { title: "How to Track Side-Hustle Expenses Without a Spreadsheet" },
          { title: "How to Know When to Form an LLC for Your Side Hustle" },
        ]},
        { slug: "bonus-equity", name: "Bonus & Equity", guides: [
          { title: "How to Plan for a Large Year-End Bonus" },
          { title: "How to Decide Between Cash and Equity" },
          { title: "How to Handle RSUs Without Overpaying in Taxes" },
          { title: "How to Evaluate Stock Options at a Startup" },
          { title: "How to Sell Employer Stock Without Getting Killed by Taxes" },
        ]},
      ]},

      { slug: "taxes", name: "Taxes", tagline: "Keeping more of what you earn.", topics: [
        { slug: "filing", name: "Filing", guides: [
          { title: "How to Choose Between DIY Tax Software and a CPA" },
          { title: "How to File a Tax Extension Without Penalties" },
          { title: "How to Amend a Tax Return You Already Filed" },
          { title: "How to File Taxes If You Moved Between States" },
          { title: "How to File Taxes After a Life Change" },
        ]},
        { slug: "deductions-credits", name: "Deductions & Credits", guides: [
          { title: "How to Know If You Should Itemize or Take the Standard Deduction" },
          { title: "How to Claim the Child Tax Credit Correctly" },
          { title: "How to Deduct Student Loan Interest" },
          { title: "How to Claim Medical Expenses on Your Taxes" },
          { title: "How to Track Charitable Donations for a Deduction" },
        ]},
        { slug: "withholding-estimated", name: "Withholding & Estimated", guides: [
          { title: "How to Adjust Your Withholding Mid-Year" },
          { title: "How to Calculate Estimated Tax Payments" },
          { title: "How to Avoid an Underpayment Penalty" },
          { title: "How to Handle Taxes on Investment Income" },
          { title: "How to Plan for a Big Capital Gain" },
        ]},
        { slug: "audits-notices", name: "Audits & Notices", guides: [
          { title: "How to Respond to an IRS Notice Without Panicking" },
          { title: "How to Survive an IRS Audit" },
          { title: "How to Dispute an IRS Penalty" },
          { title: "How to Set Up an IRS Payment Plan" },
          { title: "How to Check Your IRS Account Online" },
        ]},
      ]},

      { slug: "housing", name: "Housing", tagline: "The biggest money decision most people make.", topics: [
        { slug: "renting", name: "Renting", guides: [
          { title: "How to Budget for Renting in a New City" },
          { title: "How to Read a Lease Before You Sign" },
          { title: "How to Get Your Security Deposit Back" },
          { title: "How to Negotiate Rent at Renewal" },
          { title: "How to Know When Renting Beats Buying" },
        ]},
        { slug: "buying-a-home", name: "Buying a Home", guides: [
          { title: "How to Know If You're Actually Ready to Buy a Home" },
          { title: "How to Save for a Down Payment in 24 Months" },
          { title: "How to Get Pre-Approved for a Mortgage" },
          { title: "How to Budget for Closing Costs" },
          { title: "How to Choose Between FHA, Conventional, and VA Loans" },
        ]},
        { slug: "mortgages", name: "Mortgages", guides: [
          { title: "How to Compare Mortgage Rates Across Lenders" },
          { title: "How to Know When Refinancing Actually Saves You Money" },
          { title: "How to Pay Off Your Mortgage in 15 Years Instead of 30" },
          { title: "How to Decide Between 15-Year and 30-Year Fixed" },
          { title: "How to Recast a Mortgage After a Big Principal Payment" },
        ]},
        { slug: "home-equity", name: "Equity & Home Finance", guides: [
          { title: "How to Open a HELOC Without Getting Burned" },
          { title: "How to Use Home Equity for a Renovation" },
          { title: "How to Know When to Sell and Upgrade" },
          { title: "How to Appeal Your Property Tax Bill" },
          { title: "How to Budget for Homeowners Insurance and PMI" },
        ]},
      ]},

      { slug: "debt", name: "Debt", tagline: "How to get out and stay out.", topics: [
        { slug: "credit-card-debt", name: "Credit Card Debt", guides: [
          { title: "How to Eliminate Credit Card Debt in 12 Months" },
          { title: "How to Decide Between Snowball and Avalanche" },
          { title: "How to Negotiate a Lower APR With Your Card Issuer" },
          { title: "How to Use a 0% Balance Transfer Without Making It Worse" },
          { title: "How to Stop Using Credit Cards While Paying Off Debt" },
        ]},
        { slug: "student-loans", name: "Student Loans", guides: [
          { title: "How to Choose Between Federal Student Loan Repayment Plans" },
          { title: "How to Apply for Public Service Loan Forgiveness" },
          { title: "How to Refinance Student Loans and When Not To" },
          { title: "How to Handle Student Loan Payments on a Variable Income" },
          { title: "How to Know When Income-Driven Repayment Is a Trap" },
        ]},
        { slug: "personal-loans", name: "Personal Loans", guides: [
          { title: "How to Shop for a Personal Loan Without Tanking Your Credit" },
          { title: "How to Use a Personal Loan for Debt Consolidation" },
          { title: "How to Know If a Personal Loan Beats a Balance Transfer" },
          { title: "How to Avoid Personal Loan Origination Fees" },
          { title: "How to Read a Personal Loan Offer Before You Sign" },
        ]},
        { slug: "debt-crisis", name: "Debt Crisis", guides: [
          { title: "How to Talk to a Creditor About Hardship" },
          { title: "How to Know If You Should File Bankruptcy" },
          { title: "How to Choose Between Chapter 7 and Chapter 13" },
          { title: "How to Handle Collections Calls" },
          { title: "How to Rebuild After a Bankruptcy Discharge" },
        ]},
      ]},

      { slug: "credit", name: "Credit", tagline: "The number that opens doors.", topics: [
        { slug: "credit-scores", name: "Scores", guides: [
          { title: "How to Raise Your Credit Score 50 Points in 90 Days" },
          { title: "How to Understand the 5 Factors That Move Your Score" },
          { title: "How to Keep Utilization Low Without Paying More" },
          { title: "How to Get Your Credit Reports for Free" },
          { title: "How to Interpret a Credit Score Change You Didn't Expect" },
        ]},
        { slug: "credit-cards", name: "Credit Cards", guides: [
          { title: "How to Choose Your First Credit Card" },
          { title: "How to Use a Credit Card Without Paying Interest" },
          { title: "How to Know When to Close an Old Card and When Not To" },
          { title: "How to Get a Credit Limit Increase" },
          { title: "How to Pick a Rewards Card That Actually Rewards You" },
        ]},
        { slug: "credit-reports", name: "Reports & Disputes", guides: [
          { title: "How to Dispute an Error on Your Credit Report" },
          { title: "How to Remove a Late Payment From Your Report" },
          { title: "How to Freeze Your Credit to Prevent Fraud" },
          { title: "How to Read a Credit Report in 10 Minutes" },
          { title: "How to Recover From Identity Theft" },
        ]},
        { slug: "building-credit", name: "Building Credit", guides: [
          { title: "How to Build Credit From Scratch" },
          { title: "How to Use a Secured Card to Rebuild Credit" },
          { title: "How to Become an Authorized User the Right Way" },
          { title: "How to Use Experian Boost and Similar Tools" },
          { title: "How to Rebuild Credit After a Bankruptcy" },
        ]},
      ]},

      { slug: "investing", name: "Investing", tagline: "Growing money you don't need today.", topics: [
        { slug: "getting-started-investing", name: "Getting Started", guides: [
          { title: "How to Start Investing With $500" },
          { title: "How to Open Your First Brokerage Account" },
          { title: "How to Choose Between Fidelity, Schwab, and Vanguard" },
          { title: "How to Build a Two-Fund Portfolio That Beats Most Advisors" },
          { title: "How to Automate Monthly Investing Without Thinking About It" },
        ]},
        { slug: "portfolio-allocation", name: "Portfolio & Allocation", guides: [
          { title: "How to Pick Your Asset Allocation Based on Time Horizon" },
          { title: "How to Rebalance a Portfolio Once a Year" },
          { title: "How to Know When to Sell an Investment" },
          { title: "How to Handle a Market Crash Without Panicking" },
          { title: "How to Decide Between Lump Sum and Dollar-Cost Averaging" },
        ]},
        { slug: "taxable-brokerage", name: "Taxable Brokerage", guides: [
          { title: "How to Minimize Capital Gains Taxes on a Brokerage Account" },
          { title: "How to Use Tax-Loss Harvesting Without Making Mistakes" },
          { title: "How to Know When a Taxable Account Beats an IRA" },
          { title: "How to Plan for a Large Capital Gain Payout" },
          { title: "How to Reinvest Dividends Efficiently" },
        ]},
        { slug: "advanced-investing", name: "Advanced Topics", guides: [
          { title: "How a Rental Property Actually Fits Into a Personal Financial Plan", slug: "how-a-rental-property-actually-fits-into-a-personal-financial-plan", author: "Johnnie", status: "built" },
          { title: "How to Evaluate an Individual Stock Before Buying" },
          { title: "How to Use Options Without Losing Your Shirt" },
          { title: "How to Understand What ESG Actually Means for Your Returns" },
          { title: "How to Decide If Real Estate Belongs in Your Portfolio" },
          { title: "How to Know When to Ignore Financial News Entirely" },
        ]},
      ]},

      { slug: "retirement", name: "Retirement", tagline: "Long-term wealth. Different rules.", topics: [
        { slug: "employer-plans", name: "Employer Plans", guides: [
          { title: "How to Enroll in Your 401(k) the Right Way" },
          { title: "How to Choose Between Traditional and Roth 401(k)" },
          { title: "How to Claim Every Dollar of Employer Match" },
          { title: "How to Handle Your 401(k) When You Change Jobs" },
          { title: "How to Manage a 401(k) When Your Company Gets Acquired" },
        ]},
        { slug: "iras", name: "IRAs", guides: [
          { title: "How to Open a Roth IRA in 20 Minutes" },
          { title: "How to Do a Backdoor Roth IRA Without Triggering the Pro-Rata Rule" },
          { title: "How to Choose Between Traditional and Roth IRA" },
          { title: "How to Roll Over a 401(k) Into an IRA" },
          { title: "How to Handle Inherited IRAs Under the 10-Year Rule" },
        ]},
        { slug: "retirement-math", name: "Retirement Math", guides: [
          { title: "How to Calculate Your Real Retirement Number" },
          { title: "How to Use the 4% Rule and When Not To" },
          { title: "How to Plan for Retirement When You Start at 40" },
          { title: "How to Plan for Retirement When You're Self-Employed" },
          { title: "How to Bridge the Gap Between Retirement and Age 65" },
        ]},
        { slug: "social-security-medicare", name: "Social Security & Medicare", guides: [
          { title: "How to Decide When to Claim Social Security" },
          { title: "How to Optimize Spousal Social Security Benefits" },
          { title: "How to Choose a Medicare Plan at 65" },
          { title: "How to Estimate Your Social Security Benefit" },
          { title: "How to Handle Social Security While Still Working" },
        ]},
      ]},

      { slug: "insurance", name: "Insurance", tagline: "Protect the base, then build.", topics: [
        { slug: "health-insurance", name: "Health", guides: [
          { title: "How to Choose a Health Plan During Open Enrollment" },
          { title: "How to Use an HSA as a Retirement Account" },
          { title: "How to Handle a Surprise Medical Bill" },
          { title: "How to Know If COBRA Is Worth It" },
          { title: "How to Negotiate a Medical Bill Down" },
        ]},
        { slug: "life-disability-insurance", name: "Life & Disability", guides: [
          { title: "How to Decide How Much Life Insurance You Actually Need" },
          { title: "How to Choose Between Term and Whole Life" },
          { title: "How to Shop for Long-Term Disability Insurance" },
          { title: "How to Know If You Need Life Insurance at All" },
          { title: "How to Handle Life Insurance When You're Self-Employed" },
        ]},
        { slug: "auto-home-insurance", name: "Auto & Home", guides: [
          { title: "How to Pick Auto Insurance Coverage Amounts" },
          { title: "How to Lower Your Auto Insurance Without Losing Coverage" },
          { title: "How to File a Home Insurance Claim That Gets Paid" },
          { title: "How to Understand Dwelling vs Replacement Cost" },
          { title: "How to Know If You Need Umbrella Insurance" },
        ]},
        { slug: "specialty-insurance", name: "Specialty", guides: [
          { title: "How to Decide If You Need Long-Term Care Insurance" },
          { title: "How to Handle Flood Insurance When You're Not in a Flood Zone" },
          { title: "How to Insure a Home-Based Business" },
          { title: "How to Get Pet Insurance That Actually Pays Out" },
          { title: "How to Evaluate Identity Theft Insurance" },
        ]},
      ]},

      { slug: "family", name: "Family", tagline: "Kids, college, inheritance.", topics: [
        { slug: "new-baby", name: "New Baby", guides: [
          { title: "How to Budget for the First Year With a Baby" },
          { title: "How to Set Up a Savings Account for a Newborn" },
          { title: "How to Choose Between Childcare Options and Budget for Them" },
          { title: "How to Handle Parental Leave Financially" },
          { title: "How to Update Insurance and Benefits After a Baby" },
        ]},
        { slug: "college-saving", name: "College Saving", guides: [
          { title: "How to Open a 529 Plan and Pick the Right One" },
          { title: "How to Know When a Custodial Account Beats a 529" },
          { title: "How to Use a 529 for Someone Other Than Your Kid" },
          { title: "How to Handle a 529 With Leftover Money" },
          { title: "How to Pay for College Without Loans" },
        ]},
        { slug: "financial-aid", name: "Financial Aid & Loans", guides: [
          { title: "How to Fill Out the FAFSA Correctly" },
          { title: "How to Compare Financial Aid Packages Across Schools" },
          { title: "How to Appeal a Financial Aid Offer" },
          { title: "How to Decide If Parent PLUS Loans Are a Trap" },
          { title: "How to Negotiate Tuition at a Private College" },
        ]},
        { slug: "parenting-money", name: "Parenting Money", guides: [
          { title: "How to Teach Kids About Money at Every Age" },
          { title: "How to Set Up Chores-for-Allowance Without It Backfiring" },
          { title: "How to Open a Custodial Brokerage Account for a Kid" },
          { title: "How to Fund a Roth IRA for Your Teenager" },
          { title: "How to Pass Down Financial Literacy" },
        ]},
      ]},

      { slug: "estate", name: "Estate", tagline: "The paperwork future-you needs.", topics: [
        { slug: "wills-poa", name: "Wills & POA", guides: [
          { title: "How to Write a Simple Will Without a Lawyer" },
          { title: "How to Set Up Power of Attorney for Finances" },
          { title: "How to Choose an Executor and Tell Them" },
          { title: "How to Set Up a Healthcare Directive" },
          { title: "How to Update Your Will After a Major Life Change" },
        ]},
        { slug: "beneficiaries", name: "Beneficiaries", guides: [
          { title: "How to Review Every Beneficiary Designation You Have" },
          { title: "How to Name Beneficiaries on Retirement Accounts" },
          { title: "How to Handle a Beneficiary Who Is a Minor" },
          { title: "How to Update Beneficiaries After Divorce" },
          { title: "How to Coordinate Beneficiaries Across All Your Accounts" },
        ]},
        { slug: "trusts", name: "Trusts", guides: [
          { title: "How to Know If You Actually Need a Living Trust" },
          { title: "How to Choose Between Revocable and Irrevocable Trust" },
          { title: "How to Set Up a Trust to Avoid Probate" },
          { title: "How to Fund a Trust After You Create It" },
          { title: "How to Pick a Trustee Who Won't Let You Down" },
        ]},
        { slug: "legacy", name: "Legacy", guides: [
          { title: "How to Leave Money to Charity in Your Estate" },
          { title: "How to Create a Digital Estate for Passwords and Accounts" },
          { title: "How to Prepare Your Kids to Inherit Money" },
          { title: "How to Minimize Estate Taxes Over Your Lifetime" },
          { title: "How to Document Your Estate Plan for the People Who Will Use It" },
        ]},
      ]},

      { slug: "life-events", name: "Life Events", tagline: "When everything changes at once.", topics: [
        { slug: "marriage-divorce", name: "Marriage & Divorce", guides: [
          { title: "How to Combine Finances When You Get Married" },
          { title: "How to Decide Between a Joint and Separate Account System" },
          { title: "How to Handle a Prenup Conversation" },
          { title: "How to Divide Finances in a Divorce" },
          { title: "How to Rebuild Money Life Post-Divorce" },
        ]},
        { slug: "job-change", name: "Job Change", guides: [
          { title: "How to Survive a Layoff Financially" },
          { title: "How to Negotiate a Severance Package" },
          { title: "How to Handle a Career Pivot That Cuts Your Income" },
          { title: "How to Plan for Self-Employment From a Salaried Job" },
          { title: "How to Manage Money During a Long Job Search" },
        ]},
        { slug: "windfall", name: "Windfall", guides: [
          { title: "How to Handle an Inheritance Without Blowing It" },
          { title: "How to Think About a Large Bonus or Settlement" },
          { title: "How to Handle Lottery-Size Money If You're Lucky" },
          { title: "How to Evaluate a Buyout Offer" },
          { title: "How to Receive a Life Insurance Payout" },
        ]},
        { slug: "loss", name: "Loss", guides: [
          { title: "How to Handle Money After a Spouse Dies" },
          { title: "How to Settle a Parent's Estate" },
          { title: "How to Manage Finances Through a Serious Illness" },
          { title: "How to Claim Survivor Social Security Benefits" },
          { title: "How to Navigate the First Year of Grief Financially" },
        ]},
      ]},
    ],
  },

  business: {
    label: "Business",
    tagline: "Run the numbers, run the shop.",
    categories: [
      { slug: "entity", name: "Entity", tagline: "The legal shell your business lives in.", topics: [
        { slug: "formation", name: "Formation", guides: [
          { title: "How to Choose Between an LLC and an S-Corp in 2026" },
          { title: "How to Form an LLC in Your State in One Afternoon" },
          { title: "How to Pick a State for Your Business Formation" },
          { title: "How to Choose a Business Name That Won't Get Blocked" },
          { title: "How to Write an Operating Agreement for a Single-Member LLC" },
        ]},
        { slug: "multi-owner", name: "Multi-Owner & Partnerships", guides: [
          { title: "How to Structure a 50/50 Partnership Without Breaking the Friendship" },
          { title: "How to Write an Operating Agreement for Multiple Members" },
          { title: "How to Handle a Buy-Sell Agreement" },
          { title: "How to Split Equity Between Co-Founders Fairly" },
          { title: "How to Add a Partner to an Existing LLC" },
        ]},
        { slug: "s-corp-c-corp", name: "S-Corp & C-Corp", guides: [
          { title: "How to Elect S-Corp Status for Your LLC" },
          { title: "How to Set Your S-Corp Reasonable Salary", slug: "set-your-s-corp-reasonable-salary", author: "Isabella", status: "built" },
          { title: "How to Know When to Convert From LLC to C-Corp" },
          { title: "How to Run Payroll for a Single-Owner S-Corp" },
          { title: "How to File Your First S-Corp Tax Return" },
        ]},
        { slug: "dissolution", name: "Dissolution & Changes", guides: [
          { title: "How to Properly Dissolve a Business You're Closing" },
          { title: "How to Convert a Sole Prop to an LLC" },
          { title: "How to Change Your Business Structure Without Triggering Taxes" },
          { title: "How to Transfer Ownership of an LLC" },
          { title: "How to Handle Business Structure When Moving States" },
        ]},
      ]},

      { slug: "accounting", name: "Accounting", tagline: "The books that tell you the truth.", topics: [
        { slug: "accounting-setup", name: "Setup", guides: [
          { title: "How to Set Up Accounting for Your Solo Business" },
          { title: "How to Build a Chart of Accounts That Makes Sense" },
          { title: "How to Choose Between QuickBooks, Xero, and Wave" },
          { title: "How to Set Up Bookkeeping in 60 Minutes" },
          { title: "How to Separate Business and Personal Finances Cleanly" },
        ]},
        { slug: "monthly-books", name: "Monthly Operations", guides: [
          { title: "How to Reconcile Your Books Every Month Without Losing a Weekend" },
          { title: "How to Run a Simple Month-End Close" },
          { title: "How to Categorize Transactions Without Second-Guessing" },
          { title: "How to Handle Credit Card Receipts Without a Spreadsheet" },
          { title: "How to Track Mileage and Vehicle Expenses" },
        ]},
        { slug: "reading-the-books", name: "Reading the Books", guides: [
          { title: "How to Read Your Own P&L Without an Accountant", slug: "read-your-own-p-l-without-an-accountant", author: "Isabella", status: "built" },
          { title: "How to Read a Balance Sheet in 10 Minutes" },
          { title: "How to Read a Cash Flow Statement" },
          { title: "How to Spot When Your Books Are Wrong" },
          { title: "How to Use Your P&L to Make Real Decisions" },
        ]},
        { slug: "working-with-bookkeeper", name: "Working With a Bookkeeper", guides: [
          { title: "How to Hire a Bookkeeper for the First Time" },
          { title: "How to Fire a Bookkeeper Who Isn't Working Out" },
          { title: "How to Prepare Books for a New Bookkeeper to Take Over" },
          { title: "How to Know When You've Outgrown Self-Bookkeeping" },
          { title: "How to Work With a Bookkeeper Remotely" },
        ]},
      ]},

      { slug: "banking", name: "Banking", tagline: "Where the business money sits.", topics: [
        { slug: "business-accounts", name: "Business Accounts", guides: [
          { title: "How to Open a Business Bank Account Online" },
          { title: "How to Choose Between a Big Bank and an Online Business Bank" },
          { title: "How to Pick a Business Checking Account That Doesn't Nickel-and-Dime" },
          { title: "How to Set Up Sub-Accounts for Taxes and Reserves" },
          { title: "How to Know If You Need a Business Savings Account" },
        ]},
        { slug: "merchant-services", name: "Merchant Services", guides: [
          { title: "How to Accept Credit Cards Without Getting Killed by Fees" },
          { title: "How to Choose Between Stripe, Square, and PayPal" },
          { title: "How to Avoid Payment Processing Holds" },
          { title: "How to Handle Chargebacks Without Losing Money" },
          { title: "How to Lower Your Merchant Processing Rate" },
        ]},
        { slug: "cash-management", name: "Cash Management", guides: [
          { title: "How to Structure Business Bank Accounts for a Clean System" },
          { title: "How to Implement Profit First for Your Business" },
          { title: "How to Build a Cash Reserve for Your Business" },
          { title: "How to Move Money Between Business and Personal Without Breaking Rules" },
          { title: "How to Know When You Have Enough Operating Capital" },
        ]},
        { slug: "banking-security", name: "Banking Security", guides: [
          { title: "How to Protect Your Business From ACH Fraud" },
          { title: "How to Set Up Dual Controls on Business Accounts" },
          { title: "How to Dispute a Fraudulent Business Transaction" },
          { title: "How to Handle a Compromised Business Account" },
          { title: "How to Secure Business Banking With Multiple Employees" },
        ]},
      ]},

      { slug: "capital", name: "Capital", tagline: "Funding the work.", topics: [
        { slug: "lines-of-credit", name: "Lines of Credit", guides: [
          { title: "How to Get Approved for a Business Line of Credit" },
          { title: "How to Use a Business Credit Card the Right Way" },
          { title: "How to Keep a Line of Credit Open in Slow Months" },
          { title: "How to Decide Between a Card, a LOC, and a Term Loan" },
          { title: "How to Build Business Credit Separate From Personal" },
        ]},
        { slug: "sba-bank-loans", name: "SBA & Bank Loans", guides: [
          { title: "How to Qualify for an SBA 7(a) Loan" },
          { title: "How to Compare SBA vs Conventional Business Loans" },
          { title: "How to Prepare Loan Documents That Get Approved" },
          { title: "How to Survive an SBA Loan Review" },
          { title: "How to Know When a Bank Will Actually Lend to You" },
        ]},
        { slug: "alternative-financing", name: "Alternative Financing", guides: [
          { title: "How to Use Invoice Factoring Without Killing Your Margins" },
          { title: "How to Evaluate a Revenue-Based Financing Offer" },
          { title: "How to Decide If Equipment Financing Beats a Loan" },
          { title: "How to Avoid Predatory Merchant Cash Advances" },
          { title: "How to Use Crowdfunding the Right Way" },
        ]},
        { slug: "investor-capital", name: "Investor Capital", guides: [
          { title: "How to Raise Your First Round From Angels" },
          { title: "How to Write a Pitch Deck That Actually Gets Meetings" },
          { title: "How to Understand a SAFE vs a Priced Round" },
          { title: "How to Negotiate Term Sheets Without a VC Background" },
          { title: "How to Know If Your Business Should Raise Money At All" },
        ]},
      ]},

      { slug: "taxes", name: "Taxes", tagline: "The quiet money the IRS is waiting for.", topics: [
        { slug: "quarterly-annual", name: "Quarterly & Annual", guides: [
          { title: "How to Calculate and Pay Quarterly Estimated Taxes" },
          { title: "How to File Your Business Taxes Without a CPA" },
          { title: "How to File a Schedule C the Right Way" },
          { title: "How to Know When You Should Hire a Tax Pro" },
          { title: "How to File Multi-State Business Taxes" },
        ]},
        { slug: "business-deductions", name: "Deductions", guides: [
          { title: "How to Deduct a Home Office the Right Way" },
          { title: "How to Track Business Expenses Without Hating It" },
          { title: "How to Deduct Meals and Travel in 2026" },
          { title: "How to Write Off Business Use of Your Vehicle" },
          { title: "How to Claim Health Insurance as a Self-Employed Deduction" },
        ]},
        { slug: "payroll-contractor-taxes", name: "Payroll & Contractor Taxes", guides: [
          { title: "How to Handle Payroll Taxes as an S-Corp Owner" },
          { title: "How to File 1099s for Your Contractors" },
          { title: "How to Decide Between W-2 and 1099 for a Worker" },
          { title: "How to Correct a Misclassified Contractor" },
          { title: "How to Handle State Unemployment and SUTA" },
        ]},
        { slug: "irs-audits", name: "IRS & Audits", guides: [
          { title: "How to Respond to an IRS Business Notice" },
          { title: "How to Survive a Business Tax Audit" },
          { title: "How to Request a Business Payment Plan With the IRS" },
          { title: "How to Dispute a Penalty From the IRS" },
          { title: "How to Read an IRS Form Letter Without Panic" },
        ]},
      ]},

      { slug: "operations", name: "Operations", tagline: "Running the shop.", topics: [
        { slug: "systems-workflows", name: "Systems & Workflows", guides: [
          { title: "How to Build an Operations Manual You'll Actually Use" },
          { title: "How to Document a Process So Someone Else Can Run It" },
          { title: "How to Automate Repetitive Business Tasks" },
          { title: "How to Run a Weekly Operating Rhythm" },
          { title: "How to Choose Between Building, Buying, and Hiring It Out" },
        ]},
        { slug: "inventory-supply", name: "Inventory & Supply", guides: [
          { title: "How to Set Up Inventory Tracking for a Small Business" },
          { title: "How to Calculate Reorder Points That Prevent Stockouts" },
          { title: "How to Run a Physical Inventory Count" },
          { title: "How to Work With a Manufacturer or Supplier" },
          { title: "How to Handle Inventory Shrinkage" },
        ]},
        { slug: "vendors-procurement", name: "Vendors & Procurement", guides: [
          { title: "How to Vet a New Vendor Before Signing" },
          { title: "How to Negotiate Payment Terms With Suppliers" },
          { title: "How to Handle a Vendor Dispute" },
          { title: "How to Manage Multiple Contractors Across Projects" },
          { title: "How to Switch Vendors Without Breaking Operations" },
        ]},
        { slug: "customer-operations", name: "Customer Operations", guides: [
          { title: "How to Build a Customer Onboarding Flow" },
          { title: "How to Handle an Angry Customer Without Losing Them" },
          { title: "How to Set Up a Returns and Refunds Policy" },
          { title: "How to Handle a Customer Complaint on Social Media" },
          { title: "How to Run a Customer Feedback Loop Without a CRM" },
        ]},
      ]},

      { slug: "people", name: "People", tagline: "Hiring, paying, building culture.", topics: [
        { slug: "first-hires", name: "First Hires", guides: [
          { title: "How to Hire Your First Employee" },
          { title: "How to Decide Between an Employee and a Contractor" },
          { title: "How to Write a Job Description That Attracts the Right Person" },
          { title: "How to Run an Interview That Tells You Something Real" },
          { title: "How to Make an Offer That Gets Accepted" },
        ]},
        { slug: "payroll", name: "Payroll", guides: [
          { title: "How to Run Payroll for the First Time" },
          { title: "How to Choose Between Gusto, ADP, and Justworks" },
          { title: "How to Handle Multi-State Payroll" },
          { title: "How to Pay Yourself as an Owner" },
          { title: "How to Correct a Payroll Mistake Without Penalties" },
        ]},
        { slug: "benefits", name: "Benefits", guides: [
          { title: "How to Offer Health Insurance as a Small Business" },
          { title: "How to Set Up a 401(k) or Solo 401(k)" },
          { title: "How to Offer PTO Without It Turning Into Chaos" },
          { title: "How to Handle Parental Leave as a Small Employer" },
          { title: "How to Decide Which Benefits Actually Attract Talent" },
        ]},
        { slug: "management-culture", name: "Management & Culture", guides: [
          { title: "How to Conduct a Performance Review That Actually Helps" },
          { title: "How to Give Hard Feedback Without Damaging the Relationship" },
          { title: "How to Handle a Promotion Request" },
          { title: "How to Fire an Employee Without a Lawsuit" },
          { title: "How to Build a Culture That Survives Your First 10 Hires" },
        ]},
      ]},

      { slug: "pricing", name: "Pricing", tagline: "The most leveraged number in your business.", topics: [
        { slug: "pricing-models", name: "Pricing Models", guides: [
          { title: "How to Choose Between Hourly, Fixed, and Value Pricing" },
          { title: "How to Price a Service Business" },
          { title: "How to Price a Product Without Undercharging" },
          { title: "How to Structure Tiered Pricing That Converts" },
          { title: "How to Price a SaaS Product in 2026" },
        ]},
        { slug: "raising-prices", name: "Raising Prices", guides: [
          { title: "How to Raise Prices Without Losing Customers" },
          { title: "How to Communicate a Price Increase to Existing Customers" },
          { title: "How to Know When You're Underpricing" },
          { title: "How to Grandfather Old Customers at Old Prices" },
          { title: "How to Test a Price Change Before Committing" },
        ]},
        { slug: "discounts-promotions", name: "Discounts & Promotions", guides: [
          { title: "How to Run a Sale Without Cheapening Your Brand" },
          { title: "How to Structure a Friends-and-Family Discount" },
          { title: "How to Use Anchor Pricing Without Feeling Sleazy" },
          { title: "How to Stop Giving Away Too Much in Discounts" },
          { title: "How to Measure If a Discount Actually Worked" },
        ]},
        { slug: "revenue-operations", name: "Revenue Operations", guides: [
          { title: "How to Build a Simple Revenue Forecast" },
          { title: "How to Track Revenue by Product, Customer, and Channel" },
          { title: "How to Collect Payment Faster Without Being Pushy" },
          { title: "How to Handle a Customer Who Won't Pay" },
          { title: "How to Recognize Revenue Correctly for a Subscription Business" },
        ]},
      ]},

      { slug: "growth", name: "Growth", tagline: "Getting more customers without burning out.", topics: [
        { slug: "acquisition", name: "Acquisition", guides: [
          { title: "How to Get Your First 10 Customers" },
          { title: "How to Build a Referral Program That People Actually Use" },
          { title: "How to Choose Your First Marketing Channel" },
          { title: "How to Run a Small-Budget Google Ads Campaign" },
          { title: "How to Use LinkedIn for Business Development" },
        ]},
        { slug: "retention", name: "Retention", guides: [
          { title: "How to Calculate Your Customer Churn Rate" },
          { title: "How to Win Back a Churned Customer" },
          { title: "How to Build a Monthly Customer Touchpoint System" },
          { title: "How to Know When to Fire a Bad Customer" },
          { title: "How to Turn Customers Into Advocates" },
        ]},
        { slug: "content-brand", name: "Content & Brand", guides: [
          { title: "How to Build a Content Calendar That Fits a Real Schedule" },
          { title: "How to Write an About Page That Actually Sells" },
          { title: "How to Get Press for a Small Business" },
          { title: "How to Build an Email List Without Spam" },
          { title: "How to Know If SEO Is Worth Your Time" },
        ]},
        { slug: "funnels-conversion", name: "Funnels & Conversion", guides: [
          { title: "How to Build a Simple Sales Funnel for a Service Business" },
          { title: "How to Write a Landing Page That Converts" },
          { title: "How to Track Where Your Customers Actually Come From" },
          { title: "How to A/B Test Without a Million Visitors" },
          { title: "How to Turn a Cold Email Into a Sales Meeting" },
        ]},
      ]},

      { slug: "compliance", name: "Compliance", tagline: "Staying legal without hiring a legal team.", topics: [
        { slug: "business-licenses", name: "Business Licenses", guides: [
          { title: "How to Know Which Business Licenses You Actually Need" },
          { title: "How to Register for State Sales Tax" },
          { title: "How to Register for a DBA" },
          { title: "How to Get a Business Permit in Your City" },
          { title: "How to Keep Business Licenses Current" },
        ]},
        { slug: "industry-compliance", name: "Industry Compliance", guides: [
          { title: "How to Handle HIPAA for a Small Health Business" },
          { title: "How to Comply With GDPR as a US-Based Company" },
          { title: "How to Stay Compliant With PCI for Card Processing" },
          { title: "How to Handle Industry-Specific Reporting Requirements" },
          { title: "How to Prepare for a Compliance Audit" },
        ]},
        { slug: "reporting", name: "Reporting", guides: [
          { title: "What an Expired Certificate Actually Costs You", slug: "what-an-expired-certificate-actually-costs-you", author: "Isabella", status: "built" },
          { title: "How to File a Beneficial Ownership Report" },
          { title: "How to File Annual Reports With Your Secretary of State" },
          { title: "How to Handle Business Census Surveys" },
          { title: "How to Stay Current With Tax Filing Calendars" },
          { title: "How to Set Up a Compliance Calendar You'll Follow" },
        ]},
        { slug: "records", name: "Records", guides: [
          { title: "How to Keep Business Records the IRS Expects" },
          { title: "How to Store Records Digitally Without Losing Them" },
          { title: "How to Handle Record Retention for Different Document Types" },
          { title: "How to Destroy Sensitive Records Safely" },
          { title: "How to Prepare Records for a Sale or Audit" },
        ]},
      ]},

      { slug: "legal", name: "Legal", tagline: "The paperwork that protects the business.", topics: [
        { slug: "contracts", name: "Contracts", guides: [
          { title: "How to Write a Simple Client Contract" },
          { title: "How to Read a Contract Before You Sign It" },
          { title: "How to Use Contract Templates Without Getting Burned" },
          { title: "How to Handle a Contract Breach" },
          { title: "How to Terminate a Contract Without a Lawsuit" },
        ]},
        { slug: "ip-trademarks", name: "IP & Trademarks", guides: [
          { title: "How to File a Trademark for Your Business Name" },
          { title: "How to Protect Your Logo and Brand Assets" },
          { title: "How to Handle a Trademark Dispute" },
          { title: "How to Know If You Need a Copyright or a Trademark" },
          { title: "How to Protect IP When Working With Contractors" },
        ]},
        { slug: "ndas-employment", name: "NDAs & Employment", guides: [
          { title: "How to Use an NDA With a Contractor or Partner" },
          { title: "How to Write an Employment Agreement" },
          { title: "How to Handle a Non-Compete Clause in 2026" },
          { title: "How to Protect Trade Secrets" },
          { title: "How to Handle Employee IP Assignment" },
        ]},
        { slug: "disputes", name: "Disputes", guides: [
          { title: "How to Handle a Small Business Lawsuit" },
          { title: "How to Use Small Claims Court for a Business Debt" },
          { title: "How to Find a Business Lawyer Who Won't Nickel-and-Dime You" },
          { title: "How to Draft a Cease-and-Desist Letter" },
          { title: "How to Respond to a Demand Letter" },
        ]},
      ]},

      { slug: "insurance", name: "Insurance", tagline: "Coverage you don't think about until you need it.", topics: [
        { slug: "liability", name: "Liability", guides: [
          { title: "How to Choose General Liability Coverage for a Small Business" },
          { title: "How to Know If You Need Professional Liability" },
          { title: "How to Bundle Insurance With a BOP" },
          { title: "How to Know When Umbrella Coverage Is Worth It" },
          { title: "How to Handle a Liability Claim" },
        ]},
        { slug: "workers-employees", name: "Workers & Employees", guides: [
          { title: "How to Buy Workers Comp as a Single-Employee S-Corp" },
          { title: "How to Handle a Workers Comp Claim" },
          { title: "How to Understand Experience Modification" },
          { title: "How to Know When You're Required to Carry Workers Comp" },
          { title: "How to Lower Workers Comp Premiums" },
        ]},
        { slug: "property-business", name: "Property & Business", guides: [
          { title: "How to Insure Business Property and Equipment" },
          { title: "How to File a Business Interruption Claim" },
          { title: "How to Handle a Commercial Auto Policy" },
          { title: "How to Insure Home-Based Business Equipment" },
          { title: "How to Understand Property Valuation Methods" },
        ]},
        { slug: "specialty-business-insurance", name: "Specialty", guides: [
          { title: "How to Buy Cyber Insurance for a Small Business" },
          { title: "How to Insure a Product You're Selling" },
          { title: "How to Handle Event and Short-Term Insurance" },
          { title: "How to Compare Insurance Quotes Side-by-Side" },
          { title: "How to Know When You're Over-Insured" },
        ]},
      ]},

      { slug: "benchmarks", name: "Benchmarks", tagline: "Knowing what good looks like.", topics: [
        { slug: "margins-profitability", name: "Margins & Profitability", guides: [
          { title: "How to Know If Your Margins Are Actually Healthy" },
          { title: "How to Calculate Your Real Profit Margin", slug: "calculate-your-real-profit-margin", author: "Isabella", status: "built" },
          { title: "How to Benchmark Margins Against Your Industry" },
          { title: "How to Spot Margin Creep Before It Kills You" },
          { title: "How to Improve Gross Margin Without Raising Prices" },
        ]},
        { slug: "unit-economics", name: "Unit Economics", guides: [
          { title: "How to Calculate Your Customer Acquisition Cost" },
          { title: "How to Calculate Customer Lifetime Value" },
          { title: "How to Know If Your LTV:CAC Is Healthy" },
          { title: "How to Improve Unit Economics Without Cutting Costs" },
          { title: "How to Build a Simple Unit Economics Model" },
        ]},
        { slug: "cash-runway", name: "Cash & Runway", guides: [
          { title: "How to Calculate Your Business Runway" },
          { title: "How to Build a 13-Week Cash Flow Forecast" },
          { title: "How to Know When You're In a Cash Crisis" },
          { title: "How to Stretch Runway Without Layoffs" },
          { title: "How to Model a Cash Projection for a New Hire" },
        ]},
        { slug: "kpis", name: "KPIs", guides: [
          { title: "How to Choose Three KPIs That Actually Matter" },
          { title: "How to Build a Simple Weekly Dashboard" },
          { title: "How to Track Revenue Growth Correctly" },
          { title: "How to Benchmark Your KPIs Against Your Stage" },
          { title: "How to Know Which KPIs Lie to You" },
        ]},
      ]},

      { slug: "exit", name: "Exit", tagline: "Getting paid for the work you built.", topics: [
        { slug: "valuation", name: "Valuation", guides: [
          { title: "How to Value Your Small Business" },
          { title: "How to Understand SDE, EBITDA, and Revenue Multiples" },
          { title: "How to Prepare a Business for a Valuation" },
          { title: "How to Know If You're Getting a Fair Offer" },
          { title: "How to Raise Your Valuation in the 12 Months Before a Sale" },
        ]},
        { slug: "selling-the-business", name: "Selling the Business", guides: [
          { title: "How to Prepare to Sell Your Business in 24 Months" },
          { title: "How to Find a Business Broker Worth Working With" },
          { title: "How to Handle Due Diligence Without Losing Your Mind" },
          { title: "How to Negotiate an Earnout" },
          { title: "How to Survive the Final 90 Days Before Closing" },
        ]},
        { slug: "succession", name: "Succession", guides: [
          { title: "How to Transfer a Business to a Family Member" },
          { title: "How to Transition Ownership to Key Employees" },
          { title: "How to Set Up a Buy-Sell Agreement That Works" },
          { title: "How to Plan for Your Own Succession Over 5 Years" },
          { title: "How to Hand Off Operations Before You Exit" },
        ]},
        { slug: "after-the-exit", name: "After the Exit", guides: [
          { title: "How to Handle Taxes on a Business Sale" },
          { title: "How to Transition From Founder to Shareholder" },
          { title: "How to Think About What's Next After a Sale" },
          { title: "How to Set Up Post-Exit Wealth Management" },
          { title: "How to Honor Non-Compete and Non-Solicit Obligations" },
        ]},
      ]},
    ],
  },
};

/* =============== SLUG HELPERS =============== */

function slugifyGuideTitle(title) {
  return title
    .replace(/^How to /i, "")
    .toLowerCase()
    .replace(/['']/g, "")
    .replace(/[^a-z0-9]+/g, "-")
    .replace(/^-+|-+$/g, "")
    .slice(0, 80)
    .replace(/-+$/g, "");
}

/* Normalize: give every guide a computed slug (if not explicitly set). */
Object.values(FINANCE_TAXONOMY).forEach((lane) => {
  lane.categories.forEach((cat) => {
    cat.topics.forEach((topic) => {
      topic.guides.forEach((g) => {
        if (!g.slug) g.slug = slugifyGuideTitle(g.title);
      });
    });
  });
});

/* Flat index for quick lookups by iris-realtime URL parsing. */
const FINANCE_GUIDE_INDEX = {};  // path -> guide meta
const FINANCE_TOPIC_INDEX = {};  // path -> { lane, cat, topic }

Object.entries(FINANCE_TAXONOMY).forEach(([laneSlug, lane]) => {
  lane.categories.forEach((cat) => {
    cat.topics.forEach((topic) => {
      const topicPath = `/${laneSlug}/${cat.slug}/${topic.slug}/`;
      FINANCE_TOPIC_INDEX[topicPath] = { lane: laneSlug, category: cat.slug, topic: topic.slug };
      topic.guides.forEach((g) => {
        const path = `/${laneSlug}/${cat.slug}/${topic.slug}/${g.slug}/`;
        FINANCE_GUIDE_INDEX[path] = {
          lane: laneSlug, category: cat.slug, topic: topic.slug, slug: g.slug,
          title: g.title, author: g.author, status: g.status,
        };
      });
    });
  });
});

/* Live URLs for already-built guides, used by LaneHub / Subcat to render
   real <a href> tags vs placeholder rows. */
const LEAF_URLS = {};
Object.values(FINANCE_GUIDE_INDEX).forEach((g) => {
  if (g.status === "built") {
    const path = `/${g.lane}/${g.category}/${g.topic}/${g.slug}/`;
    LEAF_URLS[g.title] = path;
  }
});

const leafUrl = (title) => LEAF_URLS[title] || null;

Object.assign(window, {
  FINANCE_TAXONOMY,
  FINANCE_GUIDE_INDEX,
  FINANCE_TOPIC_INDEX,
  LEAF_URLS,
  leafUrl,
});
