// funnel-data.jsx — config-driven funnel definitions. The engine
// (funnel-engine.jsx) renders any funnel from one of these configs, so all 13
// funnels share one architecture. This file holds the reference build:
// Tier 1 · Stream 1 — Relationship With Money (a Type A diagnostic).

window.L180_FUNNELS = {
  // key matches a stream by tierN + stream name (see registry at bottom)
  "money-relationship": {
    key: "money-relationship",
    tierN: 1,
    type: "diagnostic",
    streamName: "Your Relationship With Money",
    tagline: "The story you tell yourself about money is driving every financial decision you make.",
    pdfName: "Money Relationship Snapshot",
    timeText: "About 5 minutes · 10 questions",

    entry: {
      hook: "Most people never realize the story they're telling themselves about money is the story driving every financial decision they make.",
      why: "Before tactics, before products, before a single dollar moves — we look at the operating system underneath it all. In about five minutes you'll uncover yours.",
    },

    framing: {
      concept: "We're going to look at four dimensions of your money relationship. None of them are \u201cbad\u201d — but when one runs the show unconsciously, it quietly shapes every decision.",
      framework: [
        { name: "Scarcity", desc: "The felt sense that there's never quite enough.", color: "#FBBF24" },
        { name: "Control", desc: "The need to hold, track, and direct every dollar.", color: "#1FC9E5" },
        { name: "Fear", desc: "The anxiety that shows up around money decisions.", color: "#DC2626" },
        { name: "Freedom", desc: "Money as a tool for the life you actually want.", color: "#24CE62" },
      ],
      receive: "At the end you'll get your Money Story archetype and a snapshot you can keep.",
    },

    // Type A diagnostic. Each question loads a value onto one dimension.
    // rate: 1..5 agreement. multiple: fixed dimension points per option.
    dimensions: [
      { key: "scarcity", name: "Scarcity", color: "#FBBF24", benchmark: 58 },
      { key: "control",  name: "Control",  color: "#1FC9E5", benchmark: 61 },
      { key: "fear",     name: "Fear",     color: "#DC2626", benchmark: 49 },
      { key: "freedom",  name: "Freedom",  color: "#24CE62", benchmark: 55 },
    ],
    questions: [
      { id: "q1", type: "rate", dim: "scarcity", q: "\u201cThere's never quite enough — no matter how much I earn.\u201d", why: "Scarcity often persists regardless of income. It's a feeling, not a number." },
      { id: "q2", type: "rate", dim: "control", q: "\u201cI need to know exactly where every dollar is, at all times.\u201d", why: "A need for total visibility can be a strength — or a cage. We're mapping which." },
      { id: "q3", type: "rate", dim: "fear", q: "\u201cThinking about money makes me anxious.\u201d", why: "Naming the emotion is the first step to it not running the decision." },
      { id: "q4", type: "rate", dim: "freedom", q: "\u201cMoney is a tool to live the life I want — not a scoreboard.\u201d", why: "How you frame money's purpose predicts how you'll deploy it." },
      { id: "q5", type: "multiple", q: "An unexpected $10,000 expense lands tomorrow. Your first feeling is…", why: "Your instant reaction reveals the dimension running underneath.",
        opts: [
          { t: "Panic — where does that even come from?", dims: { fear: 4, scarcity: 2 } },
          { t: "Let me check the exact accounts and reshuffle.", dims: { control: 4 } },
          { t: "I'll tighten everything until it's covered.", dims: { scarcity: 4 } },
          { t: "Annoying, but I'll make more — we'll be fine.", dims: { freedom: 4 } },
        ] },
      { id: "q6", type: "rate", dim: "fear", q: "\u201cI avoid looking at my accounts when I'm worried.\u201d", why: "Avoidance is fear wearing a disguise." },
      { id: "q7", type: "rate", dim: "control", q: "\u201cI'd rather keep cash on the sidelines than risk it — even if it costs growth.\u201d", why: "Control sometimes shows up as a quiet opportunity cost." },
      { id: "q8", type: "rate", dim: "scarcity", q: "\u201cI feel guilty spending money on myself.\u201d", why: "Guilt around spending is a classic scarcity signal." },
      { id: "q9", type: "rate", dim: "freedom", q: "\u201cI trust that I can make more if I need to.\u201d", why: "Self-trust is the foundation of a freedom-oriented story." },
      { id: "q10", type: "multiple", q: "When you picture financial success, it's mostly about…", why: "Your definition of success points to the story you're living.",
        opts: [
          { t: "Never having to worry about money again", dims: { fear: 3, freedom: 1 } },
          { t: "Being fully in command of my finances", dims: { control: 4 } },
          { t: "Having more than enough, a real cushion", dims: { scarcity: 3, freedom: 1 } },
          { t: "The freedom to choose how I spend my time", dims: { freedom: 4 } },
        ] },
    ],

    archetypes: {
      scarcity: {
        headline: "You're operating from a Scarcity-Driven Money Story",
        observations: [
          "Even as income grows, the feeling of \u201cnot enough\u201d tends to follow you up.",
          "You likely under-spend on yourself and over-index on saving for its own sake.",
          "Decisions get filtered through \u201cwhat if it runs out\u201d more than \u201cwhat could this build.\u201d",
        ],
        insight: "A scarcity story keeps money sleeping. The work isn't to spend recklessly — it's to give every dollar a job so saving becomes deploying with intention.",
        implications: [
          "You may be holding cash that's quietly losing to inflation out of a need for safety.",
          "Reframing saving as \u201csaving to deploy\u201d can unlock growth without sacrificing security.",
        ],
        agentBridge: "The conversation worth having: where is \u201centil\u201d costing you more than it's protecting you?",
      },
      control: {
        headline: "You're operating from a Control-Driven Money Story",
        observations: [
          "You want full visibility and command over every dollar — a real strength.",
          "You may underutilize tools that feel like a loss of control, even when they'd serve you.",
          "Risk often reads as \u201closing the wheel,\u201d so growth opportunities can stall on the sidelines.",
        ],
        insight: "Your control story means you're probably underutilizing tools that feel like loss of control — even when they'd serve you. The question: which controls are protecting you, and which are quietly costing you?",
        implications: [
          "Strategies that keep liquidity and control (like a foundation asset) tend to fit you well.",
          "The growth you want may live just past the edge of what currently feels controllable.",
        ],
        agentBridge: "The conversation worth having: which of your controls are protection, and which are just comfort?",
      },
      fear: {
        headline: "You're operating from a Fear-Driven Money Story",
        observations: [
          "Money decisions carry an emotional weight that can lead to avoidance.",
          "You may delay big decisions, which itself becomes a costly decision.",
          "Clarity — not more information — is usually what dissolves the anxiety.",
        ],
        insight: "Fear thrives in fog. Most of the anxiety isn't about the numbers — it's about not having a plan you trust. Clarity is the antidote, and it's buildable.",
        implications: [
          "A written, simple plan tends to reduce money anxiety more than higher returns do.",
          "Avoided decisions (delaying coverage, postponing a plan) often carry the highest hidden cost.",
        ],
        agentBridge: "The conversation worth having: what's the one decision you've been avoiding — and what's it actually costing?",
      },
      freedom: {
        headline: "You're operating from a Freedom-Oriented Money Story",
        observations: [
          "You see money as a tool for your life, not a scoreboard — a healthy foundation.",
          "You carry self-trust: you believe you can create more when you need to.",
          "Your risk is the opposite of the others': moving fast without a protective floor.",
        ],
        insight: "A freedom story is the goal — but freedom without a floor is fragile. The work is making sure the foundation can sustain the life you're building.",
        implications: [
          "Your upside is high; your exposure is usually on the protection / defense side.",
          "Building the floor (Tier 2) lets you take the offense you're wired for, safely.",
        ],
        agentBridge: "The conversation worth having: is your foundation strong enough to sustain the freedom you want?",
      },
    },
  },
};

// scoring: returns { dimScores (0..100), archetypeKey }
window.l180ScoreFunnel = function (cfg, answers) {
  const raw = {}; const max = {};
  cfg.dimensions.forEach((d) => { raw[d.key] = 0; max[d.key] = 0; });
  cfg.questions.forEach((q) => {
    const a = answers[q.id];
    if (q.type === "rate") {
      max[q.dim] += 5;
      raw[q.dim] += (a == null ? 3 : a); // default neutral
    } else if (q.type === "multiple") {
      // track potential max per dim from this question's biggest contribution
      const perDim = {};
      q.opts.forEach((o) => { for (const k in o.dims) perDim[k] = Math.max(perDim[k] || 0, o.dims[k]); });
      for (const k in perDim) max[k] += perDim[k];
      if (a != null && q.opts[a]) { for (const k in q.opts[a].dims) raw[k] += q.opts[a].dims[k]; }
    }
  });
  const dimScores = {};
  cfg.dimensions.forEach((d) => { dimScores[d.key] = max[d.key] ? Math.round((raw[d.key] / max[d.key]) * 100) : 0; });
  // archetype = dimension with the highest score
  let archetypeKey = cfg.dimensions[0].key, best = -1;
  cfg.dimensions.forEach((d) => { if (dimScores[d.key] > best) { best = dimScores[d.key]; archetypeKey = d.key; } });
  return { dimScores, archetypeKey };
};

// compute for Type D guided reflection (e.g. Belief Inventory)
window.l180ComputeReflect = function (cfg, selected) {
  const n = (selected || []).length;
  let archetypeKey;
  if (n === 0) archetypeKey = "clear";
  else if (n <= 2) archetypeKey = "aligned";
  else if (n <= 4) archetypeKey = "reframes";
  else archetypeKey = "rewrite";
  return { selected: selected || [], archetypeKey };
};

// compute for Type C rankers (e.g. Vision & Values)
window.l180ComputeRanker = function (cfg, ranks) {
  const themeScores = {};
  cfg.rank.themes.forEach((t) => { themeScores[t.key] = 0; });
  const n = ranks.length;
  ranks.forEach((key, i) => {
    const item = cfg.rank.items.find((it) => it.key === key);
    if (item) themeScores[item.theme] += (n - i); // rank 1 = highest weight
  });
  let archetypeKey = cfg.rank.themes[0].key, best = -1;
  cfg.rank.themes.forEach((t) => { if (themeScores[t.key] > best) { best = themeScores[t.key]; archetypeKey = t.key; } });
  return { themeScores, archetypeKey, ranks };
};

// compute for Type B tools (e.g. Cash Flow Audit)
window.l180ComputeTool = function (cfg, vals) {
  const income = +vals.income || 0;
  let committed = 0, working = 0;
  cfg.tool.categories.forEach((c) => {
    const v = +vals[c.key] || 0;
    if (c.working) working += v; else committed += v;
  });
  const totalOut = committed + working;
  const surplus = income - totalOut;           // leftover unallocated
  const sleeping = Math.max(0, surplus);        // idle leftover
  const deployable = working + sleeping;
  const deployRate = income > 0 ? deployable / income : 0;
  let archetypeKey;
  if (surplus < 0) archetypeKey = "deficit";
  else if (deployRate < 0.10) archetypeKey = "treading";
  else if (deployRate < 0.25) archetypeKey = "margin";
  else archetypeKey = "engine";
  return {
    income, committed, working, sleeping, totalOut, surplus, deployable, deployRate, archetypeKey,
    pct: {
      committed: income > 0 ? Math.min(100, (committed / income) * 100) : 0,
      working: income > 0 ? Math.min(100, (working / income) * 100) : 0,
      sleeping: income > 0 ? Math.min(100, (sleeping / income) * 100) : 0,
    },
  };
};

// registry: map a tier number + stream name -> funnel config key
window.l180FunnelKeyFor = function (tierN, streamName) {
  if (tierN === 1 && /relationship|money/i.test(streamName)) return "money-relationship";
  if (tierN === 1 && /vision|values/i.test(streamName)) return "vision-values";
  if (tierN === 1 && /holding|belief|back/i.test(streamName)) return "belief-inventory";
  if (tierN === 2 && /cash\s*flow/i.test(streamName)) return "cash-flow-audit";
  return null; // falls back to the generic stub
};

// ---- Tier 1 · Stream 3 — What's Holding You Back (Type D guided reflection) ----
window.L180_FUNNELS["belief-inventory"] = {
  key: "belief-inventory",
  tierN: 1,
  type: "reflect",
  streamName: "What's Holding You Back",
  tagline: "The beliefs you don't question are the ones running your money.",
  pdfName: "Belief Inventory",
  timeText: "About 4 minutes · reflection",

  entry: {
    hook: "Most of what holds people back financially isn't a lack of money — it's a belief they've never stopped to question.",
    why: "In about four minutes you'll name the beliefs quietly steering your decisions, see them reframed, and write the one that matters most.",
  },
  framing: {
    concept: "Beliefs aren't true or false — they're useful or costly. We'll surface the common ones, reframe them, and let you reflect on yours.",
    framework: [
      { name: "Notice", desc: "Name the belief out loud.", color: "#1FC9E5" },
      { name: "Question", desc: "Is it actually true — or just familiar?", color: "#24CE62" },
      { name: "Reframe", desc: "Replace it with something more useful.", color: "#FBBF24" },
      { name: "Decide", desc: "Act from the reframe, not the fear.", color: "#A855F7" },
    ],
    receive: "At the end you'll get your belief inventory with reframes, and your written reflection.",
  },

  // Type D: select familiar beliefs (each with a reframe) + a free reflection.
  reflect: {
    selectPrompt: "Which of these sound familiar?",
    beliefs: [
      { id: "debt", text: "“Debt is always bad.”", reframe: "Some debt is misaligned and corrosive; some is a tool that buys cash-flowing assets. The job is to sort, not to fear." },
      { id: "later", text: "“I'll invest when I make more.”", reframe: "Habits and structure compound, not just dollars. Starting small now beats starting big later — almost every time." },
      { id: "insurance", text: "“Insurance is a rip-off.”", reframe: "Badly-sold insurance is. Properly-designed protection is a foundation asset that does six jobs with one dollar." },
      { id: "window", text: "“I missed my window.”", reframe: "The best time was earlier; the second best is now. Strategy adjusts to your stage — it doesn't expire." },
      { id: "market", text: "“The market is the only way to grow wealth.”", reframe: "It's one way. Real estate, business, and foundation assets all build wealth — your DNA decides the mix." },
      { id: "bad", text: "“I'm just not good with money.”", reframe: "You were never taught — that's not a character trait, it's a curriculum gap. Clarity is a skill you can build." },
    ],
    prompt: "In your own words, what's the one money belief most holding you back right now?",
    aiContext: "You are a calm, expert financial coach for LIFE180 (faith, family, freedom; rejects Wall Street hype). Help the user begin a short, honest reflection about a limiting money belief. Write 2-3 sentences in first person they could start from, gentle and non-judgmental. Do not give financial advice.",
  },

  archetypes: {
    clear: {
      headline: "You're Clear-Eyed",
      observations: [
        "None of the common limiting beliefs grabbed you — that's rare and powerful.",
        "Your constraint is probably structure and execution, not mindset.",
        "You're ready to move straight to tactics with very little to unwind.",
      ],
      insight: "With few limiting beliefs in the way, your leverage is execution. The work isn't reframing — it's building the plan and following it.",
      implications: [
        "You can likely skip the long mindset work most people need first.",
        "Your biggest risk is overconfidence — pressure-test the plan, not the beliefs.",
      ],
      agentBridge: "The conversation worth having: what's the first concrete move now that nothing's holding you back?",
    },
    aligned: {
      headline: "You're Mostly Aligned",
      observations: [
        "A belief or two still tug at you, but your foundation of thinking is sound.",
        "These are quick reframes — not deep rewiring.",
        "Naming them is most of the battle; you've already done that.",
      ],
      insight: "A couple of beliefs are adding friction, not stopping you. Reframe them once, deliberately, and they tend to lose their grip.",
      implications: [
        "Target the one belief that touches the most decisions first.",
        "A written reframe you revisit beats willpower every time.",
      ],
      agentBridge: "The conversation worth having: which single reframe would change the most decisions for you?",
    },
    reframes: {
      headline: "You're a Few Reframes Away",
      observations: [
        "Several familiar beliefs are actively shaping your choices.",
        "This is normal — they're the defaults most of us absorbed without choosing.",
        "Each one you reframe removes a quiet brake on your progress.",
      ],
      insight: "A handful of beliefs are doing real steering. The good news: beliefs are learned, which means they can be re-learned. Reframing is the highest-leverage work you can do right now.",
      implications: [
        "Mindset work should come before tactics here — or the tactics won't stick.",
        "Education is the antidote: most of these beliefs dissolve with the right information.",
      ],
      agentBridge: "The conversation worth having: which belief, if it weren't true, would change everything?",
    },
    rewrite: {
      headline: "You're Ready for a Rewrite",
      observations: [
        "Most of the common limiting beliefs resonated — you're carrying a heavy mental load.",
        "This isn't a flaw; it's exactly why transformation precedes tactics.",
        "The upside is enormous: clearing these unlocks everything above them.",
      ],
      insight: "When this many beliefs are active, no tactic survives contact with them. The whole first tier — alignment — exists for exactly this moment. Start here and the rest gets dramatically easier.",
      implications: [
        "Prioritize education and reframing before any product or strategy conversation.",
        "Small wins that contradict the old beliefs rebuild trust fastest.",
      ],
      agentBridge: "The conversation worth having: which belief has cost you the most — and where did it come from?",
    },
  },
};

// ---- Tier 1 · Stream 2 — Vision & Values (Type C selector / ranker) ----
window.L180_FUNNELS["vision-values"] = {
  key: "vision-values",
  tierN: 1,
  type: "rank",
  streamName: "Vision & Values",
  tagline: "What does ‘enough’ look like? Start by naming what matters most.",
  pdfName: "Vision + Values Snapshot",
  timeText: "About 4 minutes · pick & rank",

  entry: {
    hook: "Every financial decision is really a values decision in disguise — we just rarely make the values explicit.",
    why: "In about four minutes you'll name the values driving your money, put them in order, and see what kind of vision they point to.",
  },
  framing: {
    concept: "We're going to do something deceptively hard: choose the few values that matter most, then force-rank them. The ranking is where the clarity lives.",
    framework: [
      { name: "Foundation", desc: "Safety, faith, peace of mind.", color: "#1FC9E5" },
      { name: "Freedom", desc: "Autonomy over your time and choices.", color: "#24CE62" },
      { name: "Legacy", desc: "The people you love and what you leave.", color: "#A855F7" },
      { name: "Growth", desc: "Becoming more — health, mastery, craft.", color: "#F97316" },
    ],
    receive: "At the end you'll get your values hierarchy and the vision it reveals.",
  },

  // Type C: curated list, pick exactly `required`, then rank.
  rank: {
    required: 5,
    themes: [
      { key: "foundation", name: "Foundation", color: "#1FC9E5" },
      { key: "freedom", name: "Freedom", color: "#24CE62" },
      { key: "legacy", name: "Legacy", color: "#A855F7" },
      { key: "growth", name: "Growth", color: "#F97316" },
    ],
    items: [
      { key: "faith", label: "Faith", theme: "foundation" },
      { key: "security", label: "Security", theme: "foundation" },
      { key: "peace", label: "Peace of Mind", theme: "foundation" },
      { key: "stability", label: "Stability", theme: "foundation" },
      { key: "freedom", label: "Freedom", theme: "freedom" },
      { key: "time", label: "Time Freedom", theme: "freedom" },
      { key: "independence", label: "Independence", theme: "freedom" },
      { key: "adventure", label: "Adventure", theme: "freedom" },
      { key: "family", label: "Family", theme: "legacy" },
      { key: "legacy", label: "Legacy", theme: "legacy" },
      { key: "generosity", label: "Generosity", theme: "legacy" },
      { key: "community", label: "Community", theme: "legacy" },
      { key: "health", label: "Health & Fitness", theme: "growth" },
      { key: "growth", label: "Personal Growth", theme: "growth" },
      { key: "mastery", label: "Mastery", theme: "growth" },
      { key: "creativity", label: "Creativity", theme: "growth" },
    ],
  },

  archetypes: {
    foundation: {
      headline: "Yours is a Foundation-Driven Vision",
      observations: [
        "Above all, you want to know your base is unshakable and your people are safe.",
        "Money, to you, is mostly about certainty — a floor that can't be pulled out.",
        "Your risk is over-protecting: holding so tightly that growth never gets to happen.",
      ],
      insight: "A foundation-driven vision means safety comes first — rightly so. The work is making sure that protection becomes a launchpad, not a ceiling. Once the floor is solid, you're free to build.",
      implications: [
        "Strategies that guarantee the floor (protection, a foundation asset) will resonate deeply with you.",
        "Your growth conversation starts only after the safety conversation is genuinely settled.",
      ],
      agentBridge: "The conversation worth having: what would have to be true for you to feel safe enough to take the next step?",
    },
    freedom: {
      headline: "Yours is a Freedom-Driven Vision",
      observations: [
        "More than anything, you're building toward autonomy over your time and choices.",
        "Money is a means to options — the ability to say yes and no on your own terms.",
        "Your risk is trading long-term freedom for short-term freedom without a plan.",
      ],
      insight: "A freedom-driven vision is about control of your time. The trap is mistaking spending freedom today for the durable freedom that comes from assets that pay you whether you work or not.",
      implications: [
        "Cash-flowing and liquid strategies map directly to the autonomy you're after.",
        "Defining your number — what 'enough' actually is — turns freedom from a feeling into a target.",
      ],
      agentBridge: "The conversation worth having: what does ‘enough’ look like, in real numbers, for the freedom you want?",
    },
    legacy: {
      headline: "Yours is a Legacy-Driven Vision",
      observations: [
        "Your money is ultimately in service of the people you love and what you leave behind.",
        "You think in generations, not quarters — provision and meaning both matter.",
        "Your risk is deferring your own life so far that you under-live the present.",
      ],
      insight: "A legacy-driven vision reaches past your own lifetime. The work is building structures that transfer not just wealth but values — and making sure you still live well along the way.",
      implications: [
        "Estate, trust, and a clean legacy vehicle (foundation asset) align tightly with what you value.",
        "Heritage — transferring values, not just dollars — is as much the goal as the money itself.",
      ],
      agentBridge: "The conversation worth having: what do you want to be remembered for — and is your money structured to say it?",
    },
    growth: {
      headline: "Yours is a Growth-Driven Vision",
      observations: [
        "You're wired to keep becoming — health, mastery, craft, expansion.",
        "Money funds your growth: the next skill, the next level, the next version of you.",
        "Your risk is always reinvesting in the climb and never securing the base camp.",
      ],
      insight: "A growth-driven vision is about expansion. The work is making sure that as you grow, you build a floor underneath you — so a setback never resets the whole climb.",
      implications: [
        "Self-investment (the $50K principle) is your highest-return move — but stage it on a stable floor.",
        "Pairing aggressive growth with a protected foundation lets you take bigger swings safely.",
      ],
      agentBridge: "The conversation worth having: what's the floor that lets you keep taking the swings you want?",
    },
  },
};

// ---- Tier 2 · Stream 1 — Cash Flow Audit (Type B interactive tool) ----
window.L180_FUNNELS["cash-flow-audit"] = {
  key: "cash-flow-audit",
  tierN: 2,
  type: "tool",
  streamName: "Cash Flow Audit",
  tagline: "Find the money that's sleeping — and put it to work.",
  pdfName: "Cash Flow Snapshot",
  timeText: "About 4 minutes · live calculator",

  entry: {
    hook: "Most people have no idea how much of their money is just sitting there — sleeping instead of working.",
    why: "In about four minutes you'll map where every dollar goes, see your real monthly surplus, and find the dollars quietly doing nothing.",
  },
  framing: {
    concept: "Cash flow is the engine of everything above it. We're looking at four things — and the one most people miss is money that's awake but idle.",
    framework: [
      { name: "Inflow", desc: "What comes in every month.", color: "#24CE62" },
      { name: "Committed", desc: "What's already spoken for.", color: "#1FC9E5" },
      { name: "Working", desc: "Dollars actively building wealth.", color: "#24CE62" },
      { name: "Sleeping", desc: "Surplus sitting idle, losing to inflation.", color: "#FBBF24" },
    ],
    receive: "At the end you'll get your surplus, your working-vs-sleeping split, and a snapshot to keep.",
  },

  // Type B: live-calculating inputs. `working:true` = counts as deployed.
  tool: {
    incomeKey: "income",
    income: { label: "Monthly income (take-home)", default: 8000, max: 30000, step: 100 },
    categories: [
      { key: "housing", label: "Housing", default: 2200, max: 8000, step: 50 },
      { key: "transport", label: "Transportation", default: 700, max: 3000, step: 50 },
      { key: "food", label: "Food & groceries", default: 900, max: 3000, step: 50 },
      { key: "debt", label: "Debt payments", default: 1100, max: 6000, step: 50 },
      { key: "lifestyle", label: "Lifestyle & other", default: 1400, max: 6000, step: 50 },
      { key: "saving", label: "Saving & investing", default: 800, max: 10000, step: 50, working: true },
    ],
  },

  archetypes: {
    deficit: {
      headline: "You're Running a Deficit",
      observations: [
        "More is going out than coming in — the floor has a leak before anything gets built.",
        "This is the highest-priority fix: no strategy survives a negative cash flow.",
        "The good news: a deficit is almost always a structure problem, not an income problem.",
      ],
      insight: "A deficit means the very first move is plugging the leak — not investing, not optimizing. Find the misaligned outflows and redirect them before building anything on top.",
      implications: [
        "Debt payments and lifestyle are usually the two largest, most fixable levers.",
        "Even a small positive surplus changes the entire trajectory of the plan.",
      ],
      agentBridge: "The conversation worth having: which two outflows, if restructured, flip you positive fastest?",
    },
    treading: {
      headline: "You're Treading Water",
      observations: [
        "You're roughly breaking even — surviving, but not yet building margin.",
        "Most of your income is committed, leaving little to deploy with intention.",
        "Small surplus gains here compound into real momentum surprisingly fast.",
      ],
      insight: "Treading water means the structure works but has no slack. The goal is to manufacture margin — every 5% of income you free up becomes deployable capital.",
      implications: [
        "Targeting one category for a 10–15% trim usually creates the first real surplus.",
        "Automating that surplus into a working asset keeps it from quietly disappearing.",
      ],
      agentBridge: "The conversation worth having: where's the easiest 5% to free up without it feeling like sacrifice?",
    },
    margin: {
      headline: "You're Building Margin",
      observations: [
        "You're generating a healthy surplus each month — the foundation is forming.",
        "The question shifts from 'can I save?' to 'is my surplus actually working?'",
        "Watch for dollars piling up idle — surplus that sleeps is opportunity lost.",
      ],
      insight: "You've got margin — now velocity matters. The risk at this stage isn't spending; it's letting surplus sleep in a checking account where it quietly loses to inflation.",
      implications: [
        "Surplus parked as idle cash is the single biggest hidden drag at this stage.",
        "Routing it into a foundation asset lets the same dollar do more than one job.",
      ],
      agentBridge: "The conversation worth having: how much of your surplus is working vs. just sitting?",
    },
    engine: {
      headline: "You're a Surplus Engine",
      observations: [
        "You're freeing up serious margin every month — a genuine wealth-building engine.",
        "At this level, deployment strategy matters far more than further frugality.",
        "Idle surplus is your biggest leak now — large balances doing nothing add up fast.",
      ],
      insight: "You don't have a savings problem — you have a deployment opportunity. The leverage now is making every surplus dollar do multiple jobs instead of sleeping.",
      implications: [
        "This is exactly the profile a foundation asset + velocity strategy is built for.",
        "The gap between 'saved' and 'deployed' is where most of your upside is hiding.",
      ],
      agentBridge: "The conversation worth having: what's the highest-velocity home for the surplus you're already generating?",
    },
  },
};
