.column-heading-button { user-select: none; touch-action: pan-y; -webkit-user-drag: none; }
.column-heading-button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-heading-button:active { cursor: grabbing; }
.column-sort-indicator, .column-filter-indicator { flex-shrink: 0; color: var(--accent); }
.order-table th.column-is-dragging { opacity: .45; }
.order-table th.column-drop-before { box-shadow: inset 3px 0 var(--accent); }
.order-table th.column-drop-after { box-shadow: inset -3px 0 var(--accent); }
.order-table th[data-column-type="number"]:not([data-column-key="quantity"]) { min-width: 140px; }
.order-sheet-footer { display: flex; align-items: center; margin-top: 12px; color: var(--muted); font-size: var(--text-meta); }
.order-sheet-footer__summary { display: flex; gap: 16px; }

/* Audience is visible in the grid, with its control at the column itself. */
.order-table .column-groups th { top: 0; left: auto; background: var(--private-tint); }
.order-table .column-groups th[data-client-visible="true"] { color: var(--accent); background: var(--accent-wash); }
.column-groups .column-group-label { position: sticky; left: var(--cell-padding-x); display: inline-block; }
.order-table .column-groups + tr > th { top: 28px; }
.order-table th[data-client-visible="true"] { background: color-mix(in srgb, var(--accent-wash) 40%, var(--surface)); }
.order-table td[data-client-visible="true"] { background: color-mix(in srgb, var(--accent-wash) 20%, var(--surface)); }
.order-table td + td, .order-table th + th { border-left-color: transparent; }
.order-table [data-client-visible="true"] + [data-client-visible="false"] { border-left: 1px solid var(--accent-line); }
.order-table .sheet-cell:not(.sheet-cell--actions) { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-table .sheet-input { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th[data-filtered="true"] .column-heading-button { color: var(--accent); }
.column-heading-button .column-draft-label { padding: 2px 5px; border: 1px solid var(--line-soft); color: var(--muted); font-size: var(--text-meta); font-weight: 400; }

.column-editor { width: 320px; }
.column-editor .column-actions__heading { padding: 0 6px 8px; }
.column-editor__name { padding: 0 6px; }
.column-editor__name > label, .column-audience legend { display: block; padding: 0; margin-bottom: 6px; color: var(--muted); font-size: var(--text-meta); font-weight: 500; }
.column-audience { margin: 0; padding: 14px 6px; }
.column-audience fieldset, fieldset.column-audience { min-width: 0; border: 0; }
.column-audience fieldset { margin: 0; padding: 0; }
.column-add__form > fieldset.column-audience { padding: 0; }
.column-audience__choices { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line-soft); border-radius: var(--radius-control); background: var(--paper); }
.column-audience__choices label { position: relative; flex: 1; margin: 0; cursor: pointer; }
.column-audience__choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.column-audience__choices span { display: flex; justify-content: center; align-items: center; gap: 7px; min-height: var(--control-height); padding: 6px 8px; border-radius: var(--radius-control); color: var(--muted); font-size: var(--text-meta); font-weight: 500; white-space: nowrap; }
.column-audience__choices .column-action-icon { flex-basis: 14px; width: 14px; height: 14px; color: inherit; }
.column-audience__choices input:checked + span { background: var(--accent-wash); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.column-audience__choices input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.column-audience__choices input:not(:checked):not(:disabled) + span:hover { color: var(--ink); background: var(--line-soft); }
.column-audience__choices label:has(input:disabled) { cursor: default; }
.column-audience__choices input:disabled:not(:checked) + span { opacity: .5; }
.column-audience .field-hint { margin-top: 7px; }
.column-audience > .button { margin-top: 10px; width: 100%; }
.column-editor__audience { padding: 0 6px 12px; color: var(--muted); font-size: var(--text-meta); }
.column-editor__sort { display: flex; align-items: center; gap: 4px; padding: 8px 6px; border-top: 1px solid var(--line-soft); font-size: var(--text-meta); }
.column-editor__sort > span { margin-right: auto; color: var(--muted); }
.column-editor__filter, .column-editor__type, .column-editor__secondary { padding-top: 4px; border-top: 1px solid var(--line-soft); }
.column-editor__filter, .column-editor__type { padding-bottom: 4px; }
.column-editor__type-value { margin-left: auto; color: var(--muted); font-size: var(--text-meta); }
.column-editor__type summary::after { margin-left: 0; }
.column-editor__secondary { display: grid; gap: 2px; }
.column-editor__secondary .column-actions__item { font-size: var(--text-dense); }
.column-filter { display: grid; gap: 10px; padding: 6px 6px 10px; }
@media (max-width: 700px) {
  .production-tools { display: block; }
  .production-tools > .order-filters { display: grid; grid-template-columns: 1fr; }
  .production-tools .filter-field, .production-tools .filter-field--search, .production-tools .order-filters__actions { grid-column: 1; }
}

.column-editor__reset { margin-bottom: 6px; }
.column-filter > .button { justify-self: start; }
.column-editor .column-name-input { width: 100%; min-width: 0; }

.column-editor__position { display: flex; align-items: center; gap: 4px; padding: 8px 6px; border-top: 1px solid var(--line-soft); }
.column-editor__position > span { margin-right: auto; color: var(--muted); font-size: var(--text-meta); }
