.tnx-entry-relation { margin: 1.2em 0; min-width: 0; max-width: 100%; }
.tnx-entry-relation-heading { display: flex; align-items: center; justify-content: space-between; gap: .7em; }
.tnx-entry-relation-heading h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; margin: .5em 0; }
.tnx-entry-relation-heading > a { flex-shrink: 0; font-size: .8em; }
.tnx-entry-relation-controls { display: flex; gap: .4em; align-items: center; }
.tnx-entry-relation-controls input { min-width: 0; flex: 1; }
.tnx-entry-relation-controls button, .tnx-entry-relation th button { border: 0; background: none; color: inherit; padding: .2em; font: inherit; }
.tnx-entry-relation-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, currentColor 30%, transparent) transparent; }
.tnx-entry-relation-scroll.is-long { max-height: 19em; }
.tnx-entry-relation-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.tnx-entry-relation-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, currentColor 30%, transparent); border-radius: 999px; }
.tnx-entry-relation table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--relation-font, 1em); }
.tnx-entry-relation th, .tnx-entry-relation td { padding: .35em .45em; text-align: left; max-width: 22em; }
.tnx-entry-relation thead th, .tnx-entry-relation tfoot th, .tnx-entry-relation tfoot td { position: sticky; background: var(--background-color, #fff); z-index: 1; }
.tnx-entry-relation thead th { top: 0; }
.tnx-entry-relation tfoot { position: sticky; bottom: 0; z-index: 1; }
.tnx-entry-relation tfoot th, .tnx-entry-relation tfoot td { position: static; border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.tnx-entry-relation input:not([type=checkbox]), .tnx-entry-relation textarea { font: inherit; box-sizing: border-box; min-width: 5em; width: 100%; }
.tnx-entry-relation-card { border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent); padding: .4em 0; }
.tnx-entry-relation-card > summary { display: flex; align-items: center; gap: .6em; cursor: pointer; list-style: none; }
.tnx-entry-relation-card > summary::-webkit-details-marker { display: none; }
.tnx-entry-relation-card > summary > a { flex: 1; }
.tnx-relation-arrow { border-radius: 50%; width: 1.6em; height: 1.6em; display: inline-grid; place-items: center; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); background: conic-gradient(color-mix(in srgb, currentColor 12%, transparent) var(--completion), transparent 0); }
.tnx-entry-relation-card[open] .tnx-relation-arrow { transform: rotate(180deg); }
.tnx-entry-relation-fields { display: grid; gap: .6em; padding: .6em; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.tnx-entry-relation-fields label { display: flex; flex-direction: column; gap: .2em; }
.tnx-entry-relation-actions { padding-top: .6em; }
.tnx-entry-relation-heading > .tnx-entry-relation-actions { margin-inline-start: auto; padding-top: 0; flex-shrink: 0; white-space: nowrap; }
.tnx-entry-relation-create { opacity: .5; }
.tnx-entry-relation-action-separator { opacity: .25; white-space: pre; }
.tnx-entry-relation-totals { display: flex; flex-wrap: wrap; gap: 1em; }
.tnx-entry-relation-error { color: var(--error-color, #c33); }
#setupEntryRelations fieldset { margin: 1em 0; display: flex; flex-wrap: wrap; gap: 1em; }
#setupEntryRelations label { display: flex; flex-direction: column; gap: .3em; }
#setupEntryRelations [hidden] { display: none; }
