{% endif %}
{{ render_cached('partials/deck_summary.html', name, request=request, summary=summary, game_changers=game_changers, owned_set=owned_set, combos=combos, synergies=synergies, versions=versions) | safe }}
{# M8: Price charts accordion — placed in main area, only available on the saved deck view #}
{% if (price_category_chart and price_category_chart.total > 0) or price_histogram_chart %}
Price Breakdownspend by category & distribution
{% if price_category_chart and price_category_chart.total > 0 %}
Spend by Category — ${{ '%.2f'|format(price_category_chart.total) }} total
{% for cat in price_category_chart.order %}
{% set cat_total = price_category_chart.totals.get(cat, 0) %}
{% if cat_total > 0 %}
{% set pct = (cat_total * 100 / price_category_chart.total) | round(1) %}
{% endif %}
{% endfor %}
{% for cat in price_category_chart.order %}
{% set cat_total = price_category_chart.totals.get(cat, 0) %}
{% if cat_total > 0 %}
{{ cat }} ${{ '%.2f'|format(cat_total) }}
{% endif %}
{% endfor %}