<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: don chen</title>
    <description>The latest articles on DEV Community by don chen (@tancybox).</description>
    <link>https://dev.to/tancybox</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3915479%2Fa06d70b1-addd-4164-bf89-0d43de01f2e4.png</url>
      <title>DEV Community: don chen</title>
      <link>https://dev.to/tancybox</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tancybox"/>
    <language>en</language>
    <item>
      <title>I Built an Open-Source Packaging Cost Calculator for E-Commerce Brands (Here's the Math)</title>
      <dc:creator>don chen</dc:creator>
      <pubDate>Mon, 20 Jul 2026 12:13:19 +0000</pubDate>
      <link>https://dev.to/tancybox/i-built-an-open-source-packaging-cost-calculator-for-e-commerce-brands-heres-the-math-gdm</link>
      <guid>https://dev.to/tancybox/i-built-an-open-source-packaging-cost-calculator-for-e-commerce-brands-heres-the-math-gdm</guid>
      <description>&lt;p&gt;I've spent over a decade in the custom packaging industry. If I had a dollar for every time an e-commerce founder asked me "how much does a box cost?", I'd have retired by now.&lt;/p&gt;

&lt;p&gt;The problem is, "how much per box" is the wrong question. It's like asking "how much does a website cost" without saying whether you need a landing page or a full-stack SaaS platform.&lt;/p&gt;

&lt;p&gt;So I built an open-source calculator that answers the &lt;em&gt;right&lt;/em&gt; question: &lt;strong&gt;"how much should you spend on packaging, given your brand's stage and product economics?"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's how the math works, why most calculators get it wrong, and the actual code you can fork.&lt;br&gt;
&lt;strong&gt;Try the live calculator:&lt;/strong&gt; &lt;a href="https://tancybox.github.io/packaging-budget-calculator/" rel="noopener noreferrer"&gt;tancybox.github.io/packaging-budget-calculator&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem With Every Packaging Calculator Online
&lt;/h2&gt;

&lt;p&gt;Most calculators ask for three things: dimensions, material, quantity. Then they spit out a unit price.&lt;/p&gt;

&lt;p&gt;This is useless for two reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The unit price isn't your real cost.&lt;/strong&gt; The box itself is only about 32% of total packaging spend. There's also the inner tray, design fees, tooling, prototypes, shipping, protective inserts, the shopping bag, the instruction card, even the warranty card tucked inside. I've seen founders budget $3/unit based on a box quote, only to discover their actual per-unit cost was $9.50 after everything.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The "right" number depends on your brand stage.&lt;/strong&gt; A startup selling $120 perfume needs to spend 10%+ of retail price on packaging — because nobody knows the brand yet and the box &lt;em&gt;is&lt;/em&gt; the first impression. An established brand at scale can spend 3%. A calculator that doesn't ask about your brand stage is giving you a number that's either too high or dangerously low.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So I decided to build something that actually models real-world packaging economics.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Formula: It Starts With Brand Stage, Not Dimensions
&lt;/h2&gt;

&lt;p&gt;The core insight is that packaging budget should be calculated as a &lt;strong&gt;percentage of retail price&lt;/strong&gt;, modulated by brand maturity and product category:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;perUnitBudget = retailPrice × budgetPercentage(brandStage, productCategory)

annualBudget = perUnitBudget × annualVolume
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where &lt;code&gt;budgetPercentage&lt;/code&gt; follows this matrix:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Brand Stage&lt;/th&gt;
&lt;th&gt;Premium/Luxury&lt;/th&gt;
&lt;th&gt;Everyday Consumer&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New (0-2 years)&lt;/td&gt;
&lt;td&gt;10% (8-12% range)&lt;/td&gt;
&lt;td&gt;1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Growing (2-5 years)&lt;/td&gt;
&lt;td&gt;5%&lt;/td&gt;
&lt;td&gt;1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Established (5+ years)&lt;/td&gt;
&lt;td&gt;3%&lt;/td&gt;
&lt;td&gt;1%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The logic: as brand equity grows, packaging can shrink as a percentage of retail price — not because it matters less, but because the brand name itself becomes the quality signal. Apple spends roughly 3% of iPhone retail price on packaging. A DTC startup launching their first product should spend 10%+.&lt;/p&gt;

&lt;p&gt;For everyday consumer goods (snacks, household items), the number is consistently 0.5-1% regardless of brand stage. Nobody is posting Instagram unboxing videos of their laundry detergent.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Breaking Down the 9 Real Cost Components
&lt;/h2&gt;

&lt;p&gt;Here's where most calculators stop. They give you a single number. But that number needs to be allocated across nine actual cost categories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;costBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;perUnitBudget&lt;/span&gt; &lt;span class="err"&gt;×&lt;/span&gt; &lt;span class="nx"&gt;allocationVector&lt;/span&gt;

&lt;span class="nx"&gt;allocationVector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;outerBox&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="mf"&gt;0.32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;    &lt;span class="c1"&gt;// The actual box&lt;/span&gt;
  &lt;span class="na"&gt;innerPackaging&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Inserts, trays, foam&lt;/span&gt;
  &lt;span class="na"&gt;designFee&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Concept, 3D modeling, revisions&lt;/span&gt;
  &lt;span class="na"&gt;shipping&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="mf"&gt;0.11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Factory to warehouse freight&lt;/span&gt;
  &lt;span class="na"&gt;protectiveMat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Bubble wrap, void fill&lt;/span&gt;
  &lt;span class="na"&gt;shoppingBag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="mf"&gt;0.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// Retail carry bag&lt;/span&gt;
  &lt;span class="na"&gt;shippingBox&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="mf"&gt;0.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// The outer carton you ship in&lt;/span&gt;
  &lt;span class="na"&gt;instructionCard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// Manuals, care guides&lt;/span&gt;
  &lt;span class="na"&gt;warrantyCard&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="mf"&gt;0.05&lt;/span&gt;    &lt;span class="c1"&gt;// Registration, authenticity cards&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These allocations come from analyzing hundreds of projects — the kind of data you only get when you've been on the factory floor watching production lines. The outer box gets the biggest slice, but the sum of the other eight categories is more than double the box cost.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The ×3 Rule&lt;/strong&gt;: whatever your factory quotes for the outer box, multiply by roughly 3 to estimate your real per-unit total.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Accounting for the "Invisible" Fixed Costs
&lt;/h2&gt;

&lt;p&gt;There are costs that don't scale with volume. Your calculator needs to flag these separately:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Fixed Cost&lt;/th&gt;
&lt;th&gt;Range&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Tooling/Mold Fee&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$100–$2,000&lt;/td&gt;
&lt;td&gt;Simple die-cut insert vs. full custom rigid box mold. One-time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Prototyping&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$500–$1,000&lt;/td&gt;
&lt;td&gt;2–3 rounds at $50–$300 each. Non-negotiable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Shipping Impact&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+15-20% on total&lt;/td&gt;
&lt;td&gt;Empty boxes are bulky. Freight from factory to your warehouse adds 15-20% to total cost.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These get amortized across your production volume:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;effectiveFixedCostPerUnit = totalFixedCosts / annualVolume
realPerUnitCost = perUnitBudget + effectiveFixedCostPerUnit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A founder ordering 500 units with $1,000 in tooling pays $2/unit extra in fixed costs. At 5,000 units, that drops to $0.20.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Interactive Calculator (Simplified Version)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Want to try it first?&lt;/strong&gt; The full version with dark mode, responsive design, and visual cost breakdown is live here: &lt;a href="https://tancybox.github.io/packaging-budget-calculator/" rel="noopener noreferrer"&gt;tancybox.github.io/packaging-budget-calculator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a minimal implementation you can drop into any page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"calc"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Brand Stage:
    &lt;span class="nt"&gt;&amp;lt;select&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"stage"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"new"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;New (0-2 years)&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"growing"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Growing (2-5 years)&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"established"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Established (5+ years)&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Product Type:
    &lt;span class="nt"&gt;&amp;lt;select&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"type"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"premium"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Premium / Luxury&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;option&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"everyday"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Everyday Consumer&lt;span class="nt"&gt;&amp;lt;/option&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/label&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Retail Price ($): &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"price"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"number"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"150"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Annual Volume: &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"volume"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"number"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"5000"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;label&amp;gt;&lt;/span&gt;Total Fixed Costs ($): &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fixed"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"number"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"1000"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/label&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"calculate()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Estimate My Budget&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"result"&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"margin-top:20px; padding:16px; background:#f7f7f7; border-radius:8px;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculate&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;stage&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;price&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;volume&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;volume&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fixedCosts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parseFloat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fixed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Budget percentage matrix&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;budgetPct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;premium&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;new&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;growing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;established&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.03&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;everyday&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;new&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;growing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;established&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.01&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="c1"&gt;// 9-component allocation&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;allocation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Outer Box&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Inner Packaging&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Design Fee&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Shipping (Factory → You)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Protective Material&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Shopping Bag&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Shipping Box&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Instruction Card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.06&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Warranty Card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;budgetPct&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nx"&gt;stage&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;perUnit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;pct&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fixedPerUnit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fixedCosts&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;volume&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;totalPerUnit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;perUnit&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;fixedPerUnit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;annualBudget&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;totalPerUnit&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;volume&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Build result using DOM APIs (no HTML strings in the source)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;resultDiv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;result&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;resultDiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;resultDiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;h3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Results&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Recommended Budget: &lt;/span&gt;&lt;span class="p"&gt;${(&lt;/span&gt;&lt;span class="nx"&gt;pct&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;% of retail price`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Per-Unit Budget: $&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;perUnit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`+ Amortized Fixed Costs: $&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;fixedPerUnit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Real Per-Unit Cost: $&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;totalPerUnit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Annual Total: $&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;annualBudget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;resultDiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;h4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cost Breakdown (per unit)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ul&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;share&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;allocation&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;amount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;perUnit&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;share&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;li&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: $&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;amount&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;ul&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;resultDiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;⚠️ This is budget planning, not a production quote. Tooling, MOQ, and shipping vary by project. Estimate prototype costs at $500–$1,000 separately.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#666&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fontSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0.85em&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;resultDiv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;note&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you a per-unit budget target with a complete line-item breakdown — exactly what you need before talking to any factory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters More Than You Think
&lt;/h2&gt;

&lt;p&gt;I've seen both ends of the spectrum fail:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 1: Underinvesting.&lt;/strong&gt; A premium skincare brand launched with beautiful product photos and generic packaging they found on Alibaba. The packaging looked like a cheap white-label gift box. Customers opened it, felt the flimsy cardboard, and assumed the $95 serum inside was equally low-quality. Return rate: 18%. They later rebranded with custom packaging at 8% of retail — return rate dropped to 3%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case 2: Overcompensating.&lt;/strong&gt; Four watch brands I worked with in the same year poured 50%+ of their launch budget into elaborate packaging while the actual product was mediocre. All four were gone within six months. Packaging gets the first purchase. The product gets the second.&lt;/p&gt;

&lt;p&gt;The real sweet spot is what I call the "×3 effect": every dollar you invest in packaging design and materials reduces the marketing spend needed to convince someone your product is worth it. One client redirected $35K from ads into packaging — six months later, their UGC, reviews, repeat rate, and CAC were all better than their competitor who spent $50K on ads and $5K on packaging.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where to Go From Here
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;If you want the full business logic&lt;/strong&gt; — including how brand stage maps to specific material choices, the six-factor pricing framework we use with real clients, and the five most common budget traps — I wrote a detailed guide here:&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://tancybox.com/packaging-budget-calculator-how-much-should-you-spend-based-on-your-brand-stage/" rel="noopener noreferrer"&gt;Packaging Budget Calculator: How Much Should You Spend Based on Your Brand Stage?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you're past the planning stage and need actual production&lt;/strong&gt; — design, prototyping, sampling, and manufacturing for custom luxury packaging — this is what professional OEM looks like:&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://tancybox.com/oem-service/" rel="noopener noreferrer"&gt;Custom Packaging OEM Service&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The full calculator code&lt;/strong&gt; (with proper form validation, responsive design, and dark mode) is on GitHub:&lt;/p&gt;

&lt;p&gt;→ &lt;a href="https://github.com/tancybox/packaging-budget-calculator" rel="noopener noreferrer"&gt;github.com/tancybox/packaging-budget-calculator&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  A Note on Shipping and MOQ
&lt;/h2&gt;

&lt;p&gt;Two numbers that constantly surprise founders: shipping empty boxes from the factory to your warehouse can add 15-20% to your total cost. And minimum order quantities (MOQ) for custom rigid boxes are typically 500-1,000 units, going up to 1,000-3,000 for fully custom structural designs.&lt;/p&gt;

&lt;p&gt;If you're ordering 500 units, your per-unit cost will be significantly higher than at 5,000 units — not because the materials are different, but because the setup costs (die-cutting molds, printing plates) are amortized across fewer pieces. The calculator's fixed cost input handles this, but it's worth understanding why the number changes so dramatically at low volumes.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you found this useful, drop a comment with your product category and I'll tell you where your packaging budget should land. I've been doing this for 18 years and genuinely enjoy helping founders get this right — it's the kind of detail that separates the brands that stick from the ones that disappear.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ecommerce</category>
      <category>product</category>
      <category>startup</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How We Built an AI-Powered Packaging Design Workflow (And the Numbers Behind It)</title>
      <dc:creator>don chen</dc:creator>
      <pubDate>Wed, 06 May 2026 08:59:29 +0000</pubDate>
      <link>https://dev.to/tancybox/how-we-built-an-ai-powered-packaging-design-workflow-and-the-numbers-behind-it-354k</link>
      <guid>https://dev.to/tancybox/how-we-built-an-ai-powered-packaging-design-workflow-and-the-numbers-behind-it-354k</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;TL;DR: We integrated AI image generation into our packaging design process in early 2025. After helping 46 brands, here's what actually works, what doesn't, and why AI is a communication tool — not a replacement for designers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The Real Problem: It's Never Been About Design Skills
&lt;/h2&gt;

&lt;p&gt;Let me start with something nobody talks about enough.&lt;/p&gt;

&lt;p&gt;In custom luxury packaging — jewelry boxes, watch cases, perfume packaging — the bottleneck is almost never "the designer isn't skilled enough." The real problem is much more boring:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clients can't describe what they want in words. And designers aren't mind readers.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client: "I want something premium but also modern, maybe with an eco feel?"
Designer: *disappears for 3 days, returns with 2 sketches*
Client: "Yeah... not exactly what I had in mind."
*repeat for 6 weeks*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've seen this pattern play out hundreds of times at &lt;a href="https://tancybox.com" rel="noopener noreferrer"&gt;Tancy Packaging&lt;/a&gt;, where we've been manufacturing custom packaging since 2008. The talent was never the issue. The issue was that &lt;strong&gt;visual ideas don't translate well into language&lt;/strong&gt;, and every round of back-and-forth burns time and budget.&lt;/p&gt;

&lt;p&gt;That's where AI actually helps. Not by replacing designers — but by acting as a rapid visual translation layer between client and designer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our Three-Stage Workflow (With Real Timelines)
&lt;/h2&gt;

&lt;p&gt;After 18 months of iteration, here's the workflow we landed on:&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 1 — AI-Powered Ideation (Days 1-2)
&lt;/h3&gt;

&lt;p&gt;Instead of a designer vanishing to produce 2-3 concept sketches over several days, we now generate &lt;strong&gt;20-30 reference images in a single afternoon session&lt;/strong&gt; — often with the client sitting right there with us.&lt;/p&gt;

&lt;p&gt;The key enabler here is something I don't see discussed enough: &lt;strong&gt;a structured prompt library.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We built ours incrementally over the past year+. Every prompt is organized by:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Example Values&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product type&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;watch boxes&lt;/code&gt;, &lt;code&gt;jewelry boxes&lt;/code&gt;, &lt;code&gt;perfume boxes&lt;/code&gt;, &lt;code&gt;cosmetic sets&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Material&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;wood grain&lt;/code&gt;, &lt;code&gt;PU leather&lt;/code&gt;, &lt;code&gt;matte paperboard&lt;/code&gt;, &lt;code&gt;velvet interior&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Style vibe&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;minimalist&lt;/code&gt;, &lt;code&gt;vintage luxe&lt;/code&gt;, &lt;code&gt;eco-friendly&lt;/code&gt;, &lt;code&gt;art deco&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Finish&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;soft-touch lamination&lt;/code&gt;, &lt;code&gt;foil stamping&lt;/code&gt;, &lt;code&gt;embossing&lt;/code&gt;, &lt;code&gt;spot UV&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A typical prompt from our library:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Rigid gift box with magnetic closure, soft-touch matte black exterior,
brushed gold foil stamping logo on lid, velvet-lined interior tray
for jewelry, photorealistic product photography lighting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why the prompt library matters:&lt;/strong&gt; Most teams treat AI prompts as throwaway experiments. Type something, see what comes out, move on. That's fine for exploration, but it's terrible for consistency. By saving and categorizing every prompt that produced good results, we built a reusable system where new projects start at ~80% of optimal instead of zero.&lt;/p&gt;

&lt;p&gt;The client participation piece is critical too. Instead of saying "I want elegant" and hoping we guess correctly, clients browse prompt categories, pick combinations like &lt;code&gt;"elegant + wood grain + warm tones"&lt;/code&gt;, and immediately see what that looks like. &lt;strong&gt;It turns vague language into concrete visuals.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 2 — Human Refinement (Days 3-7)
&lt;/h3&gt;

&lt;p&gt;Here's the part most AI-in-design articles gloss over: &lt;strong&gt;those AI images never make it into production. Ever.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the client picks a direction from Stage 1, our human team takes over completely:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;🔄 Workflow Flow:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AI References → Direction Set → 2D Artwork (Illustrator/Photoshop) → 3D Modeling (Blender/KeyShot) → CAD Validation (Manufacturability Check) → Client Review → Physical Sample&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(If client requests tweaks at review stage, loop back to 3D modeling step)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What happens in each step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;2D artwork:&lt;/strong&gt; Dielines, print files, color separation in Illustrator/Photoshop&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3D modeling:&lt;/strong&gt; Photorealistic renders from multiple angles in Blender or KeyShot&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CAD validation:&lt;/strong&gt; Structural integrity checks — will this box actually hold together?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 3D modeling step is where the magic happens for client communication. Once modeled, you can show exactly how:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Foil stamping catches light from different angles&lt;/li&gt;
&lt;li&gt;The interior cushion sits when the lid opens&lt;/li&gt;
&lt;li&gt;Whether the hinge mechanism feels smooth or clunky&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;AI cannot do this. Not because of some philosophical reason, but because this level of detail control requires understanding physical material properties, manufacturing tolerances, and human-object interaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stage 3 — Physical Prototyping (Days 8-14)
&lt;/h3&gt;

&lt;p&gt;Because so much gets validated digitally first, the first physical sample typically lands at &lt;strong&gt;85-90% approval rate&lt;/strong&gt;. Historically it was closer to 60%.&lt;/p&gt;

&lt;p&gt;Sample rounds dropped from 4 iterations to 1-2 on average.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real Case Study
&lt;/h2&gt;

&lt;p&gt;Earlier this year, a European jewelry brand came to us for holiday collection gift boxes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Traditional timeline (our old workflow):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Concept development: 2 weeks&lt;/li&gt;
&lt;li&gt;Design refinement: 2 weeks&lt;/li&gt;
&lt;li&gt;Sample iterations: 4 rounds (~3 weeks)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total: ~6 weeks&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;With AI-assisted workflow:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Phase&lt;/th&gt;
&lt;th&gt;Days&lt;/th&gt;
&lt;th&gt;What Happened&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;AI ideation&lt;/td&gt;
&lt;td&gt;1-2&lt;/td&gt;
&lt;td&gt;Client nailed down "brushed gold foil on matte black with soft interior reveal" — a specificity level that normally took 2 weeks of email ping-pong&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3D modeling + render&lt;/td&gt;
&lt;td&gt;3-6&lt;/td&gt;
&lt;td&gt;Rendered from all angles; client requested interior tray tweaks; updated same day&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First sample&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Client approved with only minor color adjustments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Production green-light&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;14&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Made their shipping window&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Two weeks instead of six.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What AI Still Can't Do (Honest Assessment)
&lt;/h2&gt;

&lt;p&gt;After 46 brands and hundreds of design cycles, here's where AI consistently falls short:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Manufacturability Blindness
&lt;/h3&gt;

&lt;p&gt;AI generates visually stunning designs that would be &lt;strong&gt;impossible to produce&lt;/strong&gt; at any reasonable cost. It doesn't understand die-cut limitations, minimum wall thicknesses, or assembly constraints.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Brand Strategy Void
&lt;/h3&gt;

&lt;p&gt;An AI doesn't know whether your positioning is "accessible luxury" vs "ultra-exclusive." Those two directions require fundamentally different approaches to materials, finishes, and unboxing experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Supply Chain Reality
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client: "Can we use this gorgeous textured paper?"
Reality: "12-week lead time from Vietnam, MOQ 5,000 units,
         and the texture disappears under soft-touch lamination."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AI has no concept of lead times, MOQs, or material interactions during finishing processes.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Tactile Judgment
&lt;/h3&gt;

&lt;p&gt;You cannot determine from an image whether a finish feels premium or cheap when held. This sounds obvious, but it's the #1 reason AI-generated concepts need human reinterpretation before production.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Numbers So Far
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Brands served with this workflow&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;46&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Time from brief to production-ready design&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;10-14 days&lt;/strong&gt; (was 4-6 weeks)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Average sample iterations&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;1-2 rounds&lt;/strong&gt; (was 3-4)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First-sample approval rate&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;~85-90%&lt;/strong&gt; (was ~60%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project types&lt;/td&gt;
&lt;td&gt;Jewelry boxes, watch cases, perfume packaging, cosmetic sets, gift boxes&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Practical Takeaways
&lt;/h2&gt;

&lt;p&gt;If you're working at the intersection of AI and physical product design, here are 3 things I'd suggest:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Use AI for volume, not quality
&lt;/h3&gt;

&lt;p&gt;AI excels at generating lots of options quickly. It's terrible at picking the right one. Your value as a professional is in &lt;strong&gt;curating and refining&lt;/strong&gt;, not in how many images you can generate.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Build a prompt library from day one
&lt;/h3&gt;

&lt;p&gt;Every time you find a prompt that produces good results for your domain, save it. Categorize it. This compound advantage grows surprisingly fast — after 6 months, our prompt library covered roughly 80% of incoming client requests without starting from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Be honest about AI's limits with clients
&lt;/h3&gt;

&lt;p&gt;The vendors who oversell AI capabilities end up disappointing clients when the physical product doesn't match the AI render. We frame it explicitly: &lt;em&gt;"AI helps us explore directions fast. Humans make sure it can actually be manufactured."&lt;/em&gt; Clients appreciate the transparency.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;The headline number — 46 brands — sounds impressive until you realize each one ended up with packaging unique to them. Not because AI customized anything magically, but because AI handled the repetitive exploration phase, freeing our designers to focus on the parts requiring human judgment: brand alignment, material selection, manufacturability, and those tiny details that separate "good enough" from "wow."&lt;/p&gt;

&lt;p&gt;If you're doing anything similar (or completely different) with AI in product design workflows, &lt;a href="https://tancybox.com/contact-us/" rel="noopener noreferrer"&gt;I'd love to hear about it&lt;/a&gt; — this field is moving fast and we're all still figuring out the best practices together.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tags: ai, design, productivity, workflow&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This article reflects our team's experience at Tancy Packaging since early 2025. We're a custom packaging manufacturer based in Guangzhou, serving 3,000+ brands across 30+ countries since 2008.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>design</category>
      <category>productivity</category>
      <category>workflow</category>
    </item>
  </channel>
</rss>
