No priced positions.
{% else %}
{% set total = tiles|sum(attribute='market_value') %}
{% for t in tiles %}
{# Color: slate base; subtle emerald wash for winners, rose for losers, slate for unknown.
Picks ensure the tile reads as an allocation block first, P/L second. #}
{% if t.unrealized_pl is none %}
{% set bg = '#94a3b8' %}{% set fg = '#0f172a' %}
{% elif t.unrealized_pl > 0 %}
{% set bg = '#10b981' %}{% set fg = '#ffffff' %}
{% elif t.unrealized_pl < 0 %}
{% set bg = '#f43f5e' %}{% set fg = '#ffffff' %}
{% else %}
{% set bg = '#94a3b8' %}{% set fg = '#0f172a' %}
{% endif %}
{% set pct = (t.market_value|float / total|float * 100) if total|float > 0 else 0 %}
{# Show full label only on tiles big enough to read; otherwise ticker only. #}
{% set big = (t.width_pct >= 14 and t.height_pct >= 22) %}
{% set show_ticker = (t.width_pct >= 6 and t.height_pct >= 12) %}
{% if big %}
{{ t.symbol }}
${{ "%.0f"|format(t.market_value|float) }}
{{ "%.1f"|format(pct) }}%
{% elif show_ticker %}
{{ t.symbol }}
{% endif %}
{% endfor %}