{% if detail %}

{{ detail.identity.public_identifier }}

{{ _('customer.linkedin') }}
{% if detail.identity.linkedin_url %}{{ detail.identity.public_identifier }}{% else %}—{% endif %}
{{ _('customer.email') }}
{{ detail.identity.contact_info.email if detail.identity.contact_info and detail.identity.contact_info.email else '—' }}
{{ _('customer.phone') }}
{{ detail.identity.contact_info.phone_number if detail.identity.contact_info and detail.identity.contact_info.phone_number else '—' }}
{{ _('customer.state') }}
{{ detail.deal.state }}
{{ _('customer.outcome') }}
{{ detail.deal.outcome or '—' }}
{{ _('customer.connect_attempts') }}
{{ detail.deal.connect_attempts }}
{{ _('customer.updated_at') }}
{{ detail.deal.updated_at | localtime or '—' }}
{# Free text does not belong in a two-column key/value grid: a long value stretches its row and leaves the neighbouring column full of gaps. #}

{{ _('customer.reason') }}

{% if detail.deal.reason %}{{ detail.deal.reason }}{% else %}—{% endif %}

{{ _('customer.profile_summary') }}

{% if detail.summaries.profile %}{{ detail.summaries.profile.facts | join(' · ') }}{% else %}{{ _('customer.empty_summary') }}{% endif %}

{{ _('customer.chat_summary') }}

{% if detail.summaries.chat %}{{ detail.summaries.chat.facts | join(' · ') }}{% else %}{{ _('customer.empty_summary') }}{% endif %}

{{ _('customer.messages') }}

{% for msg in detail.messages %}
{% if msg.is_outgoing %}{{ _('brand') }}{% else %}{{ detail.identity.public_identifier }}{% endif %}{{ msg.text }}
{% else %}

{{ _('customer.empty_messages') }}

{% endfor %}
{% else %}

{{ _('customer.title') }}

{{ _('customer.not_found') }}

{% endif %}