.accordion-item {
    border-bottom: 1px solid #E0E6EC;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-title {
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    font-weight: 500;
    width: 100%;
}

.accordion-content {
    padding: 0 10px 10px;
}

.accordion-content .record {
    columns: 150px 3;
    column-gap: 1rem;
}

.accordion-content .record > * {
    break-inside: avoid;
}

/* Suppress mt-2 on the first visible field, matching the :nth-child pattern
   in boxes.css "Reduce top space" rules. Those rules adjust .card-body padding,
   but CSS columns suppress top margin at column breaks (columns 2+) while
   preserving it on the first element in the flow, so it must be zeroed here. */
.accordion-content .record > div.mt-2:nth-child(1 of :not(.hidden):not([type=hidden])) {
    margin-top: 0 !important;
}

.unset-fields-hidden .accordion-content .record > div.mt-2:nth-child(1 of :not(.hidden):not([type=hidden]):not(.unset-field)) {
    margin-top: 0 !important;
}

.accordion-item-bare {
    padding: 5px;
}

.accordion-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.accordion-title > .accordion-toggle {
    margin-left: auto;
}

.accordion-toggle {
    cursor: pointer;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: calc(0.5rem + 16px + 2*var(--bs-border-width));
    width: calc(0.5rem + 16px + 2*var(--bs-border-width));
    line-height: 1;
}

.accordion-toggle:after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    -webkit-transform: translateY(1px) rotate(-135deg);
    -ms-transform: translateY(1px) rotate(-135deg);
    transform: translateY(1px) rotate(-135deg);
    transition: transform .25s;
}

.accordion-toggle.collapsed:after {
    -webkit-transform: translateY(-1px) rotate(45deg);
    -ms-transform: translateY(-1px) rotate(45deg);
    transform: translateY(-1px) rotate(45deg);
}

.value>.accordion .accordion-item-bare:first-child,
.value>.accordion .accordion-item:first-child .accordion-title {
    padding-top: 0;
}

.value>.accordion .accordion-item-bare,
.value>.accordion .accordion-item .accordion-title {
    padding-left: 0;
}
