.order-table th[data-column-id] { padding: 0; text-align: left; }
.column-heading-button { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 44px; padding: 12px 15px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 500 var(--text-meta)/1.4 var(--sans); text-align: left; cursor: pointer; 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:hover, .column-heading-button[aria-expanded="true"] { background: var(--accent-wash); color: var(--accent); }
.column-heading-button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.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 { position: sticky; top: 0; left: auto; height: 28px; padding: 6px 15px; color: var(--muted); font: 500 11px/16px var(--sans); background: var(--paper); }
.order-table .column-groups th[data-client-visible="true"] { color: var(--accent); background: var(--accent-wash); }
.column-groups .column-group-label { position: sticky; left: 15px; 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-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-editor .column-name-input { width: 100%; min-width: 0; min-height: 40px; font: 500 var(--text-ui)/1.4 var(--sans); }
.column-editor .column-name-input[aria-invalid="true"] { outline: 2px solid var(--red); background: var(--red-wash); }
.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: 0; 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: 34px; padding: 6px 8px; border-radius: 0; 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__choice { display: inline-flex; justify-content: center; align-items: center; min-height: 36px; padding: 7px 9px; border: 1px solid transparent; border-radius: 0; color: var(--ink); text-decoration: none; }
.column-editor__choice:hover { color: var(--ink); background: var(--paper); }
.column-editor__choice[aria-current="true"] { border-color: var(--accent-line); color: var(--accent); background: var(--accent-wash); }
.column-editor__choice:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.column-editor__reset { display: inline-flex; align-items: center; min-height: 36px; margin: 0 0 6px; padding: 7px 10px; border-radius: 0; color: var(--muted); font-size: var(--text-meta); text-decoration: none; }
.column-editor__reset:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.column-editor__reset:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.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; }
.column-filter .text-link { justify-self: start; display: inline-flex; align-items: center; min-height: 36px; padding: 7px 10px; border-radius: 0; font-size: var(--text-meta); text-decoration: none; }
.column-filter .text-link:hover { background: var(--accent-wash); }
.column-actions .select-input { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23766a6c' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
@media (max-width: 700px) {
  .column-heading-button { padding-inline: 12px; }
  .column-editor .column-name-input { font-size: var(--text-body); }
  .column-audience__choices span, .column-editor__choice, .column-editor__reset, .column-filter .text-link { min-height: 44px; }
  .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; }
}

@media (pointer: coarse) {
  .column-audience__choices span, .column-editor__choice, .column-editor__reset, .column-filter .text-link { min-height: 44px; }
}
