<section>
    {{#each choices}}
    <fieldset class="traits card">
        <legend>{{ label }}</legend>
        {{> ".tool-list" choices=children topLevel=true }}
    </fieldset>
    {{/each}}
</section>

{{#*inline ".tool-list"}}
<ol class="unlist trait-list">
    {{#if (and children topLevel (not otherGroup))}}
    {{> ".tool-entry" label=(localize "DND5E.TraitAll" category=label) children=false }}
    {{/if}}
    {{#each choices}}{{> ".tool-entry" }}{{/each}}
</ol>
{{/inline}}

{{#*inline ".tool-entry"}}
<li {{~#if category}} class="category"{{/if}} data-key="{{ @key }}">
    <proficiency-cycle type="skill" name="system.tools.{{ @key }}.value" value="{{ value }}"
                       data-tooltip aria-label="{{ localize tooltip }}"></proficiency-cycle>
    <label class="name">{{ label }}</label>
    {{#if children}}
    {{> ".tool-list" choices=children topLevel=false }}
    {{/if}}
    {{#if hasEntry}}
    <div class="bonus">{{ dnd5e-formatModifier total }}</div>
    <a class="config-button" data-action="configure" data-tooltip aria-label="{{ localize "DND5E.ToolConfigure" }}">
        <i class="fa-solid fa-cog" inert></i>
    </a>
    {{/if}}
</li>
{{/inline}}
