main:has(.setup-database-editor) { max-width: none; box-sizing: border-box; }
.setup-database-editor {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.setup-database-editor > :not(form) { flex: none; }
.setup-database-editor > .configuration-utility-links { margin-top: .35rem; }
#tableEditorForm { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.setup-database-content { flex: 1; min-height: 0; min-width: 0; overflow: auto; container-type: size; scrollbar-gutter: stable; }
.setup-columns-section { display: flex; flex-direction: column; min-height: 0; max-height: 100cqh; }
.setup-columns-section > :not(#columnsWrapper) { flex: none; }
#columnsWrapper {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    max-width: 100%;
    position: relative;
    overscroll-behavior: auto;
    scrollbar-gutter: stable;
    overflow-anchor: none;
}
#columnsWrapper.tnx-table-scroll-viewport[data-tnx-custom-horizontal-scrollbar="1"] {
    overflow-x: hidden;
    touch-action: pan-y pinch-zoom;
}
#setupTableActions { display: flex; flex: none; align-items: center; justify-content: center; flex-wrap: wrap; gap: .6rem 1rem; padding-top: .75rem; }
#setupTableActions button { width: 100%; margin: 0; padding: .75rem 1.5rem; }
#setupTableActions #removeTableLink { font-size: .85rem; }
#setupSchemaImpact { text-align: start; width: min(100%, 48rem); margin: 1rem auto; }
.setup-impact-section { margin: .25rem 0; line-height: 1.6; }
.setup-impact-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto 1ch; align-items: baseline; column-gap: .4rem; padding: .15rem 0; text-transform: uppercase; }
.setup-impact-heading > :first-child { margin-inline-end: .6rem; }
.setup-impact-flag { white-space: pre; }
.setup-impact-attention > .setup-impact-heading .setup-impact-count, .setup-impact-flag { color: orange; font-weight: bold; }
.setup-impact-entity:is(a) { text-transform: uppercase; }
summary.setup-impact-heading { color: var(--link-color); font-weight: bold; cursor: var(--tnx-cursor-pointer, pointer); list-style: none; }
summary.setup-impact-heading::-webkit-details-marker { display: none; }
summary.setup-impact-heading:focus-visible { outline: 2px solid var(--link-color); outline-offset: 2px; }
.setup-impact-section > summary.setup-impact-heading .setup-impact-count.setup-impact-unknown { color: var(--text-color); opacity: .5; }
.setup-impact-count { font-variant-numeric: tabular-nums; }
.setup-impact-empty { color: var(--text-color); opacity: .5; cursor: default; }
.setup-impact-details { margin-inline-start: 1.25rem; }
.setup-impact-section[open] > .setup-impact-details { padding-block-end: 1lh; }
.setup-impact-owner { margin-block: .25rem; }
.setup-impact-change { overflow-wrap: anywhere; }
.setup-impact-entity { font-weight: normal; }
.setup-impact-more { opacity: .5; font-size: .85em; }
.setup-impact-notices, .setup-impact-notice { margin-block: 1lh 0; }
.setup-impact-section .setup-impact-notice, .setup-impact-section p.setup-impact-warning { margin-block: 0; }
.setup-impact-warning { color: orange; }
.setup-impact-minor { color: var(--text-color); opacity: .5; }
#setupEntryRelations {
    display: flex;
    flex-direction: column;
    max-height: 100cqh;
    min-height: 0;
    min-width: 0;
    margin-block: 1.5rem;
    text-align: start;
}
#setupEntryRelations > h3 { flex: none; margin: 0 0 .75rem; text-align: center; }
.setup-relations-scroll { min-height: 0; overflow: auto; scrollbar-gutter: stable; padding: .25rem .5rem .5rem; }
#setupEntryRelations .setup-relation-card {
    min-width: 0;
    margin: 0 0 1rem;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}
#setupEntryRelations .setup-relation-card:last-child { margin-bottom: 0; }
.setup-relation-card > legend { max-width: 100%; padding: 0 6px; box-sizing: border-box; overflow-wrap: anywhere; }
.setup-relation-heading { display: inline-flex; align-items: center; gap: .35em; min-width: 0; max-width: 100%; }
.setup-relation-heading > :last-child { min-width: 0; overflow-wrap: anywhere; }
.setup-relation-settings { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.setup-relation-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.setup-relation-fields:has(> :not([hidden])) { margin-top: 1rem; }
.setup-relation-fields > .setup-relation-field { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: .4rem; }
.setup-relation-fields > .setup-relation-field > label { margin-bottom: 0 !important; }
.setup-relation-field { min-width: 0; }
#setupEntryRelations label { margin: 0; text-align: start; }
.setup-relation-field > label { display: flex; justify-content: space-between; align-items: start; gap: .5rem; margin-bottom: .4rem !important; }
/* The chevron is the general one of every dropdown (UI/style.css). */
.setup-relation-select select { max-width: 100%; text-overflow: ellipsis; }
#setupEntryRelations .setup-relation-check { display: flex; align-items: center; gap: .6rem; min-width: 0; cursor: var(--tnx-cursor-pointer, pointer); }
.setup-relation-check input[type="checkbox"] { flex: none; margin: 0; }
.setup-relation-check > span { min-width: 0; overflow-wrap: anywhere; }
.setup-relation-preview { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; cursor: var(--tnx-cursor-pointer, pointer); }
.setup-relation-preview input[type="checkbox"] { margin: 0; }
[data-relation-inside] { margin-top: .6rem !important; }
.setup-relation-check:has(input:disabled), .setup-relation-preview:has(input:disabled) { opacity: .5; cursor: var(--tnx-cursor-default, default); }
.setup-relation-choices { display: flex; flex-direction: column; box-sizing: border-box; height: 18rem; min-height: 0; border: 1px solid var(--border-color); border-radius: 6px; background: var(--input-bg); overflow: hidden; }
.setup-relation-count { flex: none; font-size: .8em; opacity: .6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.setup-relation-choice-tools { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem; border-bottom: 1px solid var(--border-color); }
.setup-relation-choice-tools input { min-width: 0; width: 100%; box-sizing: border-box; padding: .5rem; }
.setup-relation-choice-tools a { font-size: .8rem; }
.setup-relation-choice-list { flex: 1; min-height: 0; overflow: auto; padding: .35rem; scrollbar-gutter: stable; }
#setupEntryRelations .setup-relation-choice-list .setup-relation-check { padding: .4rem; border-radius: 4px; }
.setup-relation-choice-section { margin-block: .35rem; }
.setup-relation-choice-section > .setup-relation-check { margin-inline-start: 1rem !important; }
.setup-relation-choice-group { padding: .4rem .4rem .25rem; font-size: .85em; font-weight: 700; overflow-wrap: anywhere; }
.setup-relation-choice-empty { padding: .5rem; opacity: .6; }
#setupEntryRelations [hidden] { display: none !important; }
@media (max-width: 1000px) {
    .setup-relation-settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width:719px) {
    .setup-database-editor { width:100% !important; max-width:100% !important; min-width:0; box-sizing:border-box; }
    #columnsWrapper.tnx-table-scroll-viewport[data-tnx-custom-horizontal-scrollbar="1"] { touch-action: pan-x pan-y pinch-zoom; }
    #columnsWrapper.has-row-cards { scrollbar-gutter:auto; }
    .setup-database-content { scrollbar-gutter:auto; }
    .setup-columns-section:has(.is-row-detail) { max-height:none; }
    .setup-database-editor.is-column-detail-open :is(#setupTableIdDisplay, #setupTableProperties, #addColumnControls, #setupTableActions, #setupEntryRelations, .configuration-utility-links, .editor-actions) { display:none; }
    /* Display and position take whole lines; the small preview check keeps the details dropdown beside it. */
    .setup-relation-settings { grid-template-columns: auto minmax(0, 1fr); gap: .75rem 1rem; }
    .setup-relation-settings > .setup-relation-field:not([data-relation-workspace]) { grid-column: 1 / -1; }
    .setup-relation-fields { grid-template-columns: minmax(0, 1fr); }
    .setup-relations-scroll { padding-inline: 0; }
    #columnsWrapper.has-row-cards.is-row-detail { max-height:none; overflow:visible; }
    #columnsWrapper.has-row-cards:not(.is-row-detail) #columnsTable,
    #columnsWrapper.has-row-cards #columnsTable thead,
    #columnsWrapper.has-row-cards #columnsTable tbody > tr,
    #columnsWrapper.has-row-cards .setup-columns-start-divider-hitbox { display:none; }
    #columnsWrapper.has-row-cards #columnsTable,
    #columnsWrapper.has-row-cards #columnsTable tbody,
    #columnsWrapper.has-row-cards #columnsTable tbody > tr.is-row-card-open { display:block; width:100%; min-width:0; }
    #columnsWrapper.has-row-cards #columnsTable td { display:block; position:static; width:100% !important; min-width:0 !important; max-width:100% !important; padding:0.6rem; border:0; border-bottom:1px solid var(--border-color); white-space:normal; text-align:start; }
    #columnsWrapper.has-row-cards #columnsTable td::before { content:attr(data-mobile-label); display:block; font-weight:600; margin-bottom:0.35rem; }
    #columnsWrapper.has-row-cards #columnsTable :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea, .column-wide-input, .column-compact-input) { width:100% !important; min-width:0 !important; max-width:100% !important; box-sizing:border-box; }
    #columnsWrapper.has-row-cards #columnsTable input[type="checkbox"] { margin-inline:0; }
}
#columnsTable {
    --column-editor-base-width: 200px;
    --column-editor-wide-width: 240px;
    --column-editor-compact-width: 100px;
    --column-editor-cell-extra-width: 12px;
    /* Where a dropdown's text starts (its 1px border plus 0.75rem padding). Text shown in place
       of a control keeps this distance, so it stands where the dropdown's text would. */
    --column-editor-text-inset: calc(0.75rem + 1px);
    /* separate borders (not collapse): collapsed borders are painted on the
       shared grid lines and never move with position:sticky cells, so the
       scrolling content shines through exactly at the border pixels */
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
}
#columnsTable th,
#columnsTable td {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 4px;
    white-space: nowrap;
    text-align: center;
    vertical-align: top;
    overflow: visible;
    box-sizing: border-box;
}
#columnsTable thead th {
    position: sticky;
    top: 0;
    z-index: 40;
    border-top: 1px solid var(--border-color);
    background-color: var(--input-bg);
    background-clip: border-box;
}
#columnsTable th:first-child,
#columnsTable td:first-child {
    border-left: 1px solid var(--border-color);
}
/* "type" stays centered over its column, the help link sits on the same line at the right edge.
   The sticky header cell is positioned already, so it anchors the link without a position rule.
   Once the column can fold, the link stands in the corner beside ⤡ instead. */
#columnsTable th.setup-columns-type-header .tnx-help-article-link {
    position: absolute;
    top: 4px;
    right: 6px;
}
#columnsTable th.setup-columns-type-header .data-workspace-header-actions .tnx-help-article-link {
    position: static;
}
/* A folded column (TNXTableInteractions.bindColumnCollapsing) is a 5px line or nothing at all, also
   where a column's own width rule names it by id: the doubled id outranks those rules. */
#columnsTable#columnsTable :is(th, td):is(.tnx-table-header--collapsed, .tnx-table-cell--collapsed) {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding-inline: 0 !important;
}
#columnsTable#columnsTable :is(th, td).tnx-table-collapsed-column-line {
    width: 5px !important;
    min-width: 5px !important;
    max-width: 5px !important;
}
#columnsTable th {
    background-color: var(--input-bg);
}
#columnsTable td input,
#columnsTable th input {
    display:block;
    margin:0 auto;
}
#columnsTable td select,
#columnsTable td textarea,
#columnsTable th select,
#columnsTable th textarea {
    display:block;
    margin:0 auto;
}
#columnsTable input:not([type="checkbox"]) {
    min-width: var(--column-editor-base-width);
    width: var(--column-editor-base-width);
    text-align:left;
    box-sizing: border-box;
}
#columnsTable select,
#columnsTable textarea {
    min-width: var(--column-editor-base-width);
    width: var(--column-editor-base-width);
    box-sizing: border-box;
}
/* A type shown as plain text (locked or a single choice, SchedulingTypeSelector.js) takes the
   dropdown's width and starts where the dropdown's text starts, also from the top: cells stay
   top-aligned like the dropdowns, however tall the row. Longer names end in "...", the full name
   stays in the hover title. */
#columnsTable .tnx-field-type-label:not([hidden]) {
    display: block;
    width: var(--column-editor-base-width);
    max-width: 100%;
    margin: 0 auto;
    padding-block-start: var(--column-editor-text-inset);
    padding-inline: var(--column-editor-text-inset);
    line-height: normal;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: start;
}
#columnsTable textarea.column-default-value-input {
    min-width: var(--column-editor-base-width);
    width: var(--column-editor-base-width);
    resize: none;
    overflow-y: auto;
}
#columnsTable th#dropdownOptionsHeader,
#columnsTable th#calculationsHeader,
#columnsTable th#placeholderHeader,
#columnsTable td[data-dropdown-options-cell],
#columnsTable td[data-calculations-cell],
#columnsTable td[data-placeholder-cell] {
    min-width: calc(var(--column-editor-wide-width) + var(--column-editor-cell-extra-width)) !important;
    width: calc(var(--column-editor-wide-width) + var(--column-editor-cell-extra-width)) !important;
    max-width: none !important;
}
#columnsTable th#stepHeader,
#columnsTable th#maxLengthHeader,
#columnsTable td[data-step-cell],
#columnsTable td[data-maxlength-cell] {
    min-width: calc(var(--column-editor-compact-width) + var(--column-editor-cell-extra-width)) !important;
    width: calc(var(--column-editor-compact-width) + var(--column-editor-cell-extra-width)) !important;
    max-width: none !important;
    white-space: normal;
}
#columnsTable td[data-dropdown-options-cell] textarea,
#columnsTable td[data-calculations-cell] textarea,
#columnsTable td[data-placeholder-cell] input,
#columnsTable .column-wide-input {
    min-width: var(--column-editor-wide-width) !important;
    width: var(--column-editor-wide-width) !important;
    max-width: var(--column-editor-wide-width) !important;
}
#columnsTable td[data-dropdown-options-cell] .tnx-scheduling-type-select {
    min-width: var(--column-editor-wide-width) !important;
    width: 100% !important;
    max-width: none !important;
}
#columnsTable th#dropdownOptionsHeader,
#columnsTable td[data-dropdown-options-cell] {
    min-width: calc((var(--column-editor-wide-width) + var(--column-editor-cell-extra-width)) * 1.5) !important;
    width: calc((var(--column-editor-wide-width) + var(--column-editor-cell-extra-width)) * 1.5) !important;
}
#columnsTable td[data-dropdown-options-cell] :is(textarea, .tnx-scheduling-type-select) {
    min-width: calc(var(--column-editor-wide-width) * 1.5) !important;
    width: calc(var(--column-editor-wide-width) * 1.5) !important;
    max-width: none !important;
}
#columnsTable td[data-step-cell] input,
#columnsTable td[data-maxlength-cell] input,
#columnsTable .column-compact-input {
    min-width: var(--column-editor-compact-width) !important;
    width: var(--column-editor-compact-width) !important;
    max-width: var(--column-editor-compact-width) !important;
    padding-left: 4px;
    padding-right: 4px;
}
#columnsTable textarea.column-expand-on-focus {
    height: auto;
    min-height: 0;
    max-height: none;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    line-height: 1.3;
}
#columnsTable textarea.column-expand-on-focus:focus {
    resize: vertical;
}
#columnsTable .column-default-value-input--script {
    font-family: "Segoe Script", "Bradley Hand", "Comic Sans MS", cursive;
    font-style: italic;
}
#columnsTable input.column-label-input {
    font-weight: 700;
}
/* ensure the sticky name column matches other fields */
#columnsTable td.sticky-name input {
    min-width: 200px;
}
#columnsTable input[type="checkbox"] {
    display:block;
    margin:0 auto;
}
#columnsTable input[aria-disabled="true"],
#columnsTable select[aria-disabled="true"],
#columnsTable textarea[aria-disabled="true"],
#columnsTable input:disabled,
#columnsTable select:disabled,
#columnsTable textarea:disabled,
#columnsTable [data-column-interactive="false"] {
    cursor: var(--tnx-cursor-default, default) !important;
}
/* "depends on what" lists its suggested checkbox columns right after (none) and again at their own
   place, both copies with the same data-twin (setup-databases-core.js). A suggestion whose own place
   comes right after it is listed once, without data-twin. Where the browser draws the
   list in the page, both copies light up together: under the pointer, reached by keyboard and when
   chosen. The closed field keeps the flat look of the other dropdowns, with their normal line
   height instead of the page's. Two twins at most: the checkbox right before and the one the
   column above depends on. */
@supports (appearance: base-select) {
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"],
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]::picker(select) {
        appearance: base-select;
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"] {
        --tnx-select-system-appearance: base-select;
        line-height: normal;
        white-space: nowrap;
        overflow: hidden;
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]:open {
        opacity: 1 !important;
        border-color: var(--primary-color);
        background-color: var(--bg-color);
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]::picker-icon,
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"] option::checkmark {
        display: none;
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]::picker(select) {
        border: 1px solid var(--border-color);
        border-radius: var(--ds-radius-control, 4px);
        background-color: var(--input-bg);
        color: var(--text-color);
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"] option {
        padding: 4px 10px;
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"] option:checked,
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]:has(option[data-twin="1"]:checked) option[data-twin="1"],
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]:has(option[data-twin="2"]:checked) option[data-twin="2"] {
        background-color: color-mix(in srgb, var(--primary-color) 18%, var(--input-bg));
    }
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"] option:is(:hover, :focus-visible),
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]:has(option[data-twin="1"]:is(:hover, :focus-visible)) option[data-twin="1"],
    #columnsTable select[name="col_OnlyShowIfThisIsTrue[]"]:has(option[data-twin="2"]:is(:hover, :focus-visible)) option[data-twin="2"] {
        background-color: color-mix(in srgb, var(--primary-color) 40%, var(--input-bg));
    }
}
#columnsTable th.sticky:not(.sticky-name),
#columnsTable td.sticky:not(.sticky-name) {
    --setup-column-sticky-overlay: transparent;
    position: sticky;
    left: 0;
    background-color: var(--bg-color);
    background-image: linear-gradient(var(--setup-column-sticky-overlay), var(--setup-column-sticky-overlay));
    background-position: left top;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-clip: border-box;
    z-index: 30;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    overflow:hidden;
}
#columnsTable th.sticky,
#columnsTable th.sticky-name {
    background-color: var(--input-bg);
}
#columnsTable th.sticky-name,
#columnsTable td.sticky-name {
    --setup-column-sticky-overlay: transparent;
    position: sticky;
    left: 50px;
    z-index: 31;
    background-color: var(--bg-color);
    background-image: linear-gradient(var(--setup-column-sticky-overlay), var(--setup-column-sticky-overlay));
    background-position: left top;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-clip: border-box;
    overflow:hidden;
    box-shadow: none;
}
#columnsTable th.sticky-name {
    background-color: var(--input-bg);
}
#columnsTable thead th.sticky:not(.sticky-name) {
    z-index: 50;
}
#columnsTable thead th.sticky-name {
    z-index: 51;
}
#columnsTable td.sticky,
#columnsTable td.sticky-name,
#columnsTable td.sticky-name input {
    font-weight: bold;
}
.setup-columns-start-divider-hitbox {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    display: none;
    width: 10px;
    cursor: var(--tnx-cursor-pointer, pointer);
}
.setup-columns-start-divider-hitbox::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 4px;
    background: var(--border-color);
}
#columnsWrapper[data-scrolled-x="1"] #columnsTable th.sticky-name > .setup-columns-start-divider-hitbox,
#columnsWrapper[data-scrolled-x="1"] #columnsTable td.sticky-name > .setup-columns-start-divider-hitbox {
    display: block;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-color);
}
#further_information:focus,
#column_groups:focus {
    opacity: 1 !important;
}
.human-primary .form-control {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}
#columnsTable th.selected,
#columnsTable td.selected,
#columnsTable td.selected input,
#columnsTable td.selected select,
#columnsTable td.selected textarea {
    color: var(--accent-color);
}
#columnsTable tr.is-column-row-selected td {
    background-color: rgba(66, 133, 244, 0.12);
    box-shadow: inset 0 1px 0 var(--primary-color), inset 0 -1px 0 var(--primary-color);
}
#columnsTable tr.is-column-row-selected td.sticky,
#columnsTable tr.is-column-row-selected td.sticky-name {
    --setup-column-sticky-overlay: rgba(66, 133, 244, 0.18);
    background-color: var(--bg-color);
}
#columnsTable.has-column-row-multi-selection tr.is-column-row-selected input,
#columnsTable.has-column-row-multi-selection tr.is-column-row-selected select,
#columnsTable.has-column-row-multi-selection tr.is-column-row-selected textarea {
    border-color: var(--border-color) !important;
    outline: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
}
#columnsTable tr.is-column-row-group-dragging td {
    opacity: 0.55;
}
/* Give menu views spacing without adding borders */
.containerWithoutBorder:has(.menu-nav) {
    padding: 2rem;
    overflow-x: auto;
}

.save-buttons {
    text-align: center;
}

.save-buttons button {
    width: 220px;
    display: inline-block;
}

.save-buttons button + button {
    margin-left: 10px;
}

.save-buttons button[name="save_table"] {
    opacity: 0.5;
}

.menu-nav {
    --menu-icon-container-size: 64px;
}

.menu-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--menu-icon-container-size, 64px);
    height: var(--menu-icon-container-size, 64px);
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background-color: var(--menu-icon-bg, var(--input-bg));
}

.menu-icon-emoji {
    font-size: 2.2rem;
    line-height: 1;
}
.setup-table-name-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.setup-column-groups > label { opacity: .5; }
.setup-column-groups:focus-within > label { opacity: 1!important; }
.setup-special-table-actions {
    margin-top: 2rem;
    text-align: center;
}
.setup-special-table-actions a {
    opacity: 0.5;
}
/* Creating a second buying pair, selling pair or absences table stays fully
   possible, but such a link is dimmed by another 50% once a corresponding
   table already exists, since one is usually enough. */
.setup-special-table-actions a.setup-special-table-action-dimmed {
    opacity: 0.25;
}
.setup-special-table-actions a.setup-special-table-action-highlighted {
    opacity: 1;
    font-weight: 700;
}
.setup-special-table-actions span {
    opacity: 0.25;
}

#columnsTable :is([data-calculations-cell], [data-search-calculations-cell]) textarea[hidden] { display: none; }
#columnsTable :is([data-calculations-cell], [data-search-calculations-cell]) .tnx-executable-preview {
    height: var(--calculation-field-height, 32px);
    min-height: var(--calculation-field-height, 32px);
    max-height: var(--calculation-field-height, 32px);
    width: var(--column-editor-wide-width);
    padding: 0;
    justify-content: center;
    overflow: hidden;
}
#columnsTable :is([data-calculations-cell], [data-search-calculations-cell]) .tnx-executable-preview .api-node {
    transform: scale(var(--calculation-preview-scale, .4));
    transform-origin: left center;
    max-width: none;
    width: max-content;
}
#columnsTable :is([data-calculations-cell], [data-search-calculations-cell]) .tnx-executable-preview[hidden] { display: none; }

/* The "after <column>" insertion point next to the add-column links. It has to
   sit on the same baseline and keep the same height as the plain text links in
   that line, so the shell is height-locked to the line's own em size and the
   select itself is stripped of the global padded input look. */
.add-column-anchor {
    --add-column-anchor-height: 1.5em;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    margin-right: 0.25em;
    vertical-align: middle;
    line-height: inherit;
}
.add-column-anchor[hidden] {
    display: none;
}
.add-column-anchor-label {
    opacity: 0.5;
}
.add-column-anchor-shell {
    display: inline-flex;
    align-items: center;
    min-height: var(--add-column-anchor-height);
    height: var(--add-column-anchor-height);
    max-height: var(--add-column-anchor-height);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-bg);
    box-sizing: border-box;
    overflow: hidden;
}
.add-column-anchor-select {
    display: block;
    width: auto;
    min-width: 0;
    max-width: min(18rem, 60vw);
    margin: 0;
    padding: 0 0.25em;
    min-height: 100%;
    height: 100%;
    max-height: 100%;
    border: none;
    border-radius: 0;
    background-color: transparent;
    background-image: none;
    color: var(--text-color);
    font: inherit;
    font-size: inherit;
    line-height: inherit;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: var(--tnx-cursor-pointer, pointer);
    overflow: hidden;
    text-overflow: ellipsis;
}
.add-column-anchor-shell:focus-within {
    border-color: var(--primary-color);
}
.add-column-anchor-select:focus {
    outline: none;
    background-color: transparent;
}

/* Default values: the color swatch is exactly the plain browser swatch of the company accent
   color on UI/SetupCompany.php (the table's input rules would stretch it), and it and the
   symbol picker sit horizontally centered in their cell. */
#columnsTable td[data-role="default-value"] .tnx-structured-field { display: flex; justify-content: center; align-items: center; width: 100%; }
/* A default link is an input with its results below it, exactly like a link in a data workspace. */
#columnsTable td[data-role="default-value"] .tnx-structured-field:is([data-structured-type="table_link"], [data-structured-type="multiple_table_links"]) { display: block; text-align: start; }
#columnsTable td[data-role="default-value"] .linked-entry-search-results { margin-top: 4px; max-height: 120px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: 0 0 4px 4px; padding-left: 8px; text-align: start; }
#columnsTable td[data-role="default-value"] .linked-entry-search-results button.search-select { background: none; border: none; color: var(--link-color); padding: 0; font: inherit; text-align: left; cursor: var(--tnx-cursor-pointer, pointer); }
#columnsTable td[data-role="default-value"] .tnx-structured-field input[type="color"] { all: revert; padding: 0; cursor: var(--tnx-cursor-pointer, pointer); }
#columnsTable td[data-role="default-value"] .tnx-symbol-picker { margin-left: auto; margin-right: auto; }

/* Columns whose controls only exist in some rows (team member roles, notify) or whose label length
   varies (linked tables) keep one fixed width, so the table never changes width while rows scroll
   in and out of view. */
#columnsTable th:nth-child(10),
#columnsTable td[data-role="linked-table"],
#columnsTable #linkedFieldHeader,
#columnsTable td[data-role="linked-field"],
#columnsTable #notifyHeader,
#columnsTable td[data-role="notify"] {
    min-width: calc(var(--column-editor-base-width) + var(--column-editor-cell-extra-width));
    width: calc(var(--column-editor-base-width) + var(--column-editor-cell-extra-width));
    max-width: calc(var(--column-editor-base-width) + var(--column-editor-cell-extra-width));
}
/* The idpk of a column is text too: it starts at the height of the field texts beside it. */
#columnsTable tbody td:first-child {
    padding-top: calc(4px + var(--column-editor-text-inset));
    line-height: normal;
}
/* Linked tables and roles are text, centered, with the dropdown's distance from the top. */
#columnsTable td:is([data-role="linked-table"], [data-role="linked-field"]) .tnx-linked-selection-trigger {
    max-width: var(--column-editor-base-width);
    margin: 0 auto;
    padding-block-start: var(--column-editor-text-inset);
}
