{% if immediate or longterm %}

{% if immediate %}
<div class="focus-box" style="border-color:var(--sev-critical)">
  <h2 style="color:var(--sev-critical);margin:0 0 12px">Immediate Fixes — stop the bleeding</h2>
  {% for a in immediate %}
  <div class="focus-item">
    <div>
      <b>{{ loop.index }}. {{ a.action }}</b>
      <span style="color:var(--text-faint);font-size:12px">({{ a.effort }})</span>
      {% if a.score_gain %}<span class="score-gain">+{{ a.score_gain }} pts</span>{% endif %}
    </div>
    <div style="font-size:13px;color:var(--text-mid);margin-top:2px">{{ a.impact }}</div>
    {% if a.cmd %}<div style="margin-top:4px"><span class="action-cmd">{{ a.cmd[:120] }}</span></div>{% endif %}
  </div>
  {% endfor %}
</div>
{% endif %}

{% if longterm %}
<div class="focus-box" style="border-color:var(--accent-blue)">
  <h2 style="color:var(--accent-blue);margin:0 0 12px">Long-Term Wins — build a healthier system</h2>
  {% for a in longterm %}
  <div class="focus-item">
    <div>
      <b>{{ loop.index }}. {{ a.action }}</b>
      <span style="color:var(--text-faint);font-size:12px">({{ a.effort }})</span>
      {% if a.score_gain %}<span class="score-gain">+{{ a.score_gain }} pts</span>{% endif %}
    </div>
    <div style="font-size:13px;color:var(--text-mid);margin-top:2px">{{ a.impact }}</div>
    {% if a.cmd %}<div style="margin-top:4px"><span class="action-cmd">{{ a.cmd[:120] }}</span></div>{% endif %}
    {% if 'uninstall' in a.action|lower and redundant %}
    <div style="margin-top:6px;font-size:12px;color:var(--text-mid)">
      {% for r in redundant[:3] %}
      <div style="margin:2px 0">Remove <b>{{ r.unused.name }}</b> → you use <b>{{ r.active.name }}</b> ({{ r.reason }})</div>
      {% endfor %}
    </div>
    {% endif %}
  </div>
  {% endfor %}
</div>
{% endif %}

{% endif %}
