<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 400" width="760" height="400">
  <defs>
    <style>text { font-family: 'Noto Sans JP','Hiragino Sans',sans-serif; }</style>
  </defs>
  <rect width="760" height="400" rx="12" fill="#F8FAFC"/>
  <text x="380" y="34" text-anchor="middle" font-size="15" font-weight="700" fill="#1E293B">総合原価計算——ボックス図の構造と材料費・加工費の扱いの違い</text>

  <!-- ボックス図中央 -->
  <rect x="240" y="52" width="280" height="200" rx="10" fill="#fff" stroke="#94A3B8" stroke-width="2"/>
  <text x="380" y="74" text-anchor="middle" font-size="12" font-weight="700" fill="#1E293B">仕掛品ボックス図</text>
  <line x1="240" y1="82" x2="520" y2="82" stroke="#94A3B8" stroke-width="1.5"/>
  <line x1="380" y1="82" x2="380" y2="252" stroke="#94A3B8" stroke-width="1.5" stroke-dasharray="4,3"/>

  <!-- Left: 借方 -->
  <text x="310" y="100" text-anchor="middle" font-size="10.5" font-weight="700" fill="#374151">借　方</text>
  <text x="310" y="118" text-anchor="middle" font-size="10" fill="#374151">月初仕掛品</text>
  <text x="310" y="134" text-anchor="middle" font-size="10" fill="#64748B">（前期繰越分）</text>
  <line x1="255" y1="142" x2="375" y2="142" stroke="#CBD5E1" stroke-width="1"/>
  <text x="310" y="160" text-anchor="middle" font-size="10" fill="#374151">当月製造費用</text>
  <text x="310" y="176" text-anchor="middle" font-size="10" fill="#3B82F6">材料費（始点投入）</text>
  <text x="310" y="192" text-anchor="middle" font-size="10" fill="#F97316">加工費（進捗度配分）</text>
  <line x1="255" y1="200" x2="375" y2="200" stroke="#CBD5E1" stroke-width="1"/>
  <text x="310" y="218" text-anchor="middle" font-size="10" fill="#374151">合　計</text>
  <text x="310" y="236" text-anchor="middle" font-size="9.5" fill="#64748B">（月初＋当月）</text>

  <!-- Right: 貸方 -->
  <text x="450" y="100" text-anchor="middle" font-size="10.5" font-weight="700" fill="#374151">貸　方</text>
  <text x="450" y="120" text-anchor="middle" font-size="10" fill="#22C55E">完成品原価</text>
  <text x="450" y="136" text-anchor="middle" font-size="9.5" fill="#64748B">（製品勘定へ）</text>
  <line x1="385" y1="160" x2="515" y2="160" stroke="#CBD5E1" stroke-width="1"/>
  <text x="450" y="178" text-anchor="middle" font-size="10" fill="#EF4444">月末仕掛品原価</text>
  <text x="450" y="194" text-anchor="middle" font-size="9.5" fill="#64748B">（次期繰越）</text>
  <line x1="385" y1="210" x2="515" y2="210" stroke="#CBD5E1" stroke-width="1"/>
  <text x="450" y="230" text-anchor="middle" font-size="10" fill="#374151">合　計</text>
  <text x="450" y="246" text-anchor="middle" font-size="9.5" fill="#64748B">（借方と必ず一致）</text>

  <!-- Left panel: 材料費 -->
  <rect x="20" y="52" width="200" height="200" rx="10" fill="#EFF6FF" stroke="#93C5FD" stroke-width="2"/>
  <rect x="20" y="52" width="200" height="30" rx="10" fill="#3B82F6"/>
  <rect x="20" y="72" width="200" height="10" fill="#3B82F6"/>
  <text x="120" y="70" text-anchor="middle" font-size="11" font-weight="700" fill="#fff">材料費（始点投入）</text>
  <text x="120" y="96" text-anchor="middle" font-size="10.5" fill="#1E40AF">製造の最初に全量投入</text>
  <text x="120" y="114" text-anchor="middle" font-size="10" fill="#374151">仕掛品50%でも</text>
  <text x="120" y="130" text-anchor="middle" font-size="10" fill="#374151">材料は100%消費済み</text>
  <rect x="36" y="140" width="168" height="44" rx="6" fill="#DBEAFE"/>
  <text x="120" y="158" text-anchor="middle" font-size="10.5" font-weight="700" fill="#1D4ED8">月末仕掛品の換算量</text>
  <text x="120" y="174" text-anchor="middle" font-size="10.5" fill="#1D4ED8">＝ 個数（進捗度×無関係）</text>
  <text x="120" y="198" text-anchor="middle" font-size="10" fill="#64748B">例：月末50個(50%) →</text>
  <text x="120" y="214" text-anchor="middle" font-size="10" fill="#64748B">材料費は50個分で計算</text>
  <text x="120" y="234" text-anchor="middle" font-size="10" fill="#374151">↑ 進捗度を掛けない！</text>

  <!-- Right panel: 加工費 -->
  <rect x="540" y="52" width="200" height="200" rx="10" fill="#FFF7ED" stroke="#FDB97D" stroke-width="2"/>
  <rect x="540" y="52" width="200" height="30" rx="10" fill="#F97316"/>
  <rect x="540" y="72" width="200" height="10" fill="#F97316"/>
  <text x="640" y="70" text-anchor="middle" font-size="11" font-weight="700" fill="#fff">加工費（進捗度配分）</text>
  <text x="640" y="96" text-anchor="middle" font-size="10.5" fill="#C2410C">製造の進み具合に応じて発生</text>
  <text x="640" y="114" text-anchor="middle" font-size="10" fill="#374151">仕掛品50%なら</text>
  <text x="640" y="130" text-anchor="middle" font-size="10" fill="#374151">加工費も50%分しか発生</text>
  <rect x="556" y="140" width="168" height="44" rx="6" fill="#FFEDD5"/>
  <text x="640" y="158" text-anchor="middle" font-size="10.5" font-weight="700" fill="#C2410C">月末仕掛品の換算量</text>
  <text x="640" y="174" text-anchor="middle" font-size="10.5" fill="#C2410C">＝ 個数 × 進捗度</text>
  <text x="640" y="198" text-anchor="middle" font-size="10" fill="#64748B">例：月末50個(50%) →</text>
  <text x="640" y="214" text-anchor="middle" font-size="10" fill="#64748B">加工費は25個分で計算</text>
  <text x="640" y="234" text-anchor="middle" font-size="10" fill="#374151">↑ 進捗度を掛ける！</text>

  <!-- 矢印 left→box -->
  <line x1="220" y1="152" x2="240" y2="152" stroke="#3B82F6" stroke-width="2"/>
  <polygon points="240,148 240,156 248,152" fill="#3B82F6"/>

  <!-- 矢印 box→right -->
  <line x1="520" y1="152" x2="540" y2="152" stroke="#F97316" stroke-width="2"/>
  <polygon points="540,148 540,156 548,152" fill="#F97316"/>

  <!-- Bottom: 2メソッド -->
  <rect x="20" y="268" width="340" height="114" rx="10" fill="#F0FDF4" stroke="#86EFAC" stroke-width="2"/>
  <text x="190" y="290" text-anchor="middle" font-size="11" font-weight="700" fill="#166534">平均法</text>
  <text x="190" y="308" text-anchor="middle" font-size="10.5" fill="#374151">月初仕掛品＋当月投入を「混ぜて」平均単価を出す</text>
  <rect x="36" y="316" width="308" height="28" rx="5" fill="#DCFCE7"/>
  <text x="190" y="334" text-anchor="middle" font-size="10.5" fill="#166534">単価 ＝（月初原価＋当月原価）÷（完成品＋月末換算）</text>
  <text x="190" y="356" text-anchor="middle" font-size="10" fill="#64748B">計算がシンプル。月初仕掛品の進捗度は不要。</text>
  <text x="190" y="374" text-anchor="middle" font-size="10" fill="#64748B">完成品・月末どちらも同じ単価で計算。</text>

  <rect x="400" y="268" width="340" height="114" rx="10" fill="#FEF2F2" stroke="#FCA5A5" stroke-width="2"/>
  <text x="570" y="290" text-anchor="middle" font-size="11" font-weight="700" fill="#DC2626">先入先出法</text>
  <text x="570" y="308" text-anchor="middle" font-size="10.5" fill="#374151">月初仕掛品を「先に完成させる」考え方で計算</text>
  <rect x="416" y="316" width="308" height="28" rx="5" fill="#FEE2E2"/>
  <text x="570" y="334" text-anchor="middle" font-size="10.5" fill="#DC2626">当月単価 ＝ 当月投入原価 ÷ 当月換算量のみ</text>
  <text x="570" y="356" text-anchor="middle" font-size="10" fill="#64748B">月初仕掛品の残り加工分を当月で完成させる。</text>
  <text x="570" y="374" text-anchor="middle" font-size="10" fill="#64748B">計算がやや複雑。当月完成分のみ当月単価適用。</text>
</svg>
