{{#if parts.length}}
<div class="dice-tooltip-collapser">
  <div class="dice-tooltip">
    {{#if tooltipFormula}}
    <section class="tooltip-part">
      <div class="dice-formula">{{formula}}</div>
    </section>
    {{/if}}
    {{!-- New structured attribution (Phase A onwards) --}}
    {{#if attributions.length}}
    <section class="tooltip-part midi-attribution">
      {{#each attributions}}
      <div class="attribution-entry attribution-{{type}}">
        <span class="attribution-type">{{localizedType}}</span>
        <span class="attribution-source">{{displayName}}</span>
      </div>
      {{/each}}
    </section>
    {{/if}}
    {{!-- Legacy HTML-based attribution (backwards compatibility) --}}
    {{#if advTooltip}}
    <section class="tooltip-part">
      {{{advTooltip}}}
    </section>
    {{/if}}
    {{#each parts}}
    <section class="tooltip-part">
      <div class="dice">
        <ol class="dice-rolls">
          {{#each rolls}}
          <li class="roll {{ classes }}">{{{ result }}}</li>
          {{/each}}
        </ol>
        <div class="total">
          <span class="label">{{ flavor }}</span>
          <span class="value">{{ total }}</span>
        </div>
      </div>
    </section>
    {{/each}}
  </div>
</div>
{{/if}}
