{% if similar_pairs %}
<h2>Apps That May Serve Similar Purposes</h2>
<div class="card">
  <div style="font-size:12px;color:#475569;margin-bottom:8px">Ranked by signal strength. Review and decide — this is informational, not a recommendation.</div>
  <table>
    <tr><th>App</th><th></th><th>App</th><th>Score</th><th>Why</th></tr>
    {% for p in similar_pairs %}
    {% set score_pct = (p.score * 100)|int %}
    {% set color = '#16a34a' if score_pct >= 70 else '#ca8a04' if score_pct >= 50 else '#94a3b8' %}
    <tr>
      <td><b>{{ p.app_a }}</b></td>
      <td style="color:#94a3b8">↔</td>
      <td><b>{{ p.app_b }}</b></td>
      <td style="color:{{ color }};font-weight:600">{{ score_pct }}%</td>
      <td style="font-size:12px">{{ p.reasons }}</td>
    </tr>
    {% endfor %}
  </table>
</div>
{% endif %}

{% if redundant %}
<h2>Unused Apps With Active Alternatives</h2>
<div class="card">
  <div style="font-size:12px;color:#475569;margin-bottom:8px">These unused apps have an actively-used equivalent on your Mac.</div>
  <table>
    <tr><th>Unused App</th><th>Last Used</th><th>You Already Use</th><th>Why Similar</th></tr>
    {% for r in redundant[:10] %}
    {% set score_pct = (r.score * 100)|int %}
    {% set color = '#16a34a' if score_pct >= 70 else '#ca8a04' %}
    <tr>
      <td><b>{{ r.unused.name }}</b></td>
      <td>{{ r.unused.days_ago }}d ago</td>
      <td style="color:{{ color }}"><b>{{ r.active.name }}</b> ({{ score_pct }}% match)</td>
      <td style="font-size:12px">{{ r.reason }}</td>
    </tr>
    {% endfor %}
  </table>
</div>
{% endif %}
