/*
 * Core, UI-wide tweaks for our Unfold-based interface.
 *
 * Disable the changelist expand-row chevron when a row's expandable section
 * renders no content.
 *
 * Unfold shows the chevron for every row whenever `list_sections` is set, with
 * no per-row hook. It wraps each row's sections in `td > div.grid`; when every
 * section renders empty that wrapper has no element children, so we key off it
 * with `:has()` to keep the chevron in place (no layout gap) but not clickable.
 * Rows that render content are untouched, and changelists without
 * `list_sections` have no chevron cell so they are unaffected.
 *
 * Only the chevron icon is dimmed (not the whole cell), so the row's cell
 * border stays at full opacity and the separating line reaches the edge.
 */
#result_list
    tbody:not(:has(tr > td > div.grid > *))
    tr.data-row
    > td[data-label="Expand row"] {
    cursor: default;
    pointer-events: none;
}

#result_list
    tbody:not(:has(tr > td > div.grid > *))
    tr.data-row
    > td[data-label="Expand row"]
    .material-symbols-outlined {
    opacity: 0.3;
}

/*
 * Make the dialog-action modal overlay cover the full viewport.
 *
 * Unfold's `unfold/helpers/modal.html` ships the overlay with a `mr-1`
 * (margin-right: 4px), which leaves an uncovered strip on the right edge when
 * the page has no visible scrollbar. The id selector outranks the utility class,
 * so no !important is needed.
 */
#modal-overlay {
    margin-right: 0;
}


/*
 * A one-to-one configuration is a section of the integration, not a list of related
 * records. Unfold marks every stacked inline fieldset with a striped gutter and an
 * indent, which makes these read as an embedded object instead of part of the form.
 * Two classes outrank Unfold's single utility classes, so no !important is needed.
 */
.module.flat-config {
    border-left: 0;
    margin-left: 0;
}

.module.flat-config::before {
    display: none;
}

/*
 * An inline wraps its fieldset in a card of its own, so the fields end up inside two
 * nested bordered boxes — which is what reads as "embedded". A plain fieldset has one.
 * Drop the inner card and keep the formset's, so the section matches the rest of the form.
 */
.module.flat-config > .form-rows {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
