.tbe-pref-trigger { flex: 0 0 auto; }
.tbe-table-preferences-panel {
  position: fixed;
  z-index: 1100;
  display: grid;
  gap: 7px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line, #cfd8dc);
  border-radius: 4px;
  background: var(--surface, #fff);
  color: var(--ink, #25343c);
  box-shadow: 0 12px 32px rgba(24, 43, 48, .2);
}
.tbe-pref-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tbe-pref-heading h2 { margin: 0; color: inherit; font-size: 16px; }
.tbe-pref-done { flex: 0 0 auto; min-height: 31px; padding: 4px 9px; }
.tbe-pref-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tbe-pref-column {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 3px 5px 3px 8px;
  border: 1px solid var(--line, #cfd8dc);
  border-radius: 3px;
  background: var(--surface, #fff);
}
.tbe-pref-column[draggable="true"] { cursor: grab; }
.tbe-pref-column.is-dragging { opacity: .55; }
.tbe-pref-column.is-drop-target { border-color: var(--teal-dark, #345e31); background: var(--teal-pale, #eff5e8); }
.tbe-pref-column-name { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.tbe-pref-locked { color: var(--muted, #52616a); font-size: 12px; white-space: nowrap; }
.tbe-pref-visibility { display: inline-flex; align-items: center; gap: 5px; color: var(--muted, #52616a); cursor: pointer; font-size: 12px; white-space: nowrap; }
.tbe-pref-visibility input { width: 16px; height: 16px; margin: 0; accent-color: var(--teal-dark, #345e31); }
.tbe-pref-reorder { display: inline-flex; gap: 3px; }
.tbe-pref-move {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line, #cfd8dc);
  border-radius: 3px;
  background: var(--surface, #fff);
  color: var(--ink, #25343c);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.tbe-pref-move:disabled { opacity: .4; cursor: not-allowed; }
.tbe-pref-move:not(:disabled):hover { border-color: var(--teal-dark, #345e31); background: var(--teal-pale, #eff5e8); }
.tbe-pref-status { min-height: 1em; margin: 0; color: var(--muted, #52616a); font-size: 12px; }
.tbe-pref-footer { display: flex; justify-content: flex-end; padding-top: 5px; border-top: 1px solid var(--line, #cfd8dc); }
.tbe-pref-footer .button { min-height: 29px; padding: 4px 8px; font-size: 13px; }

.data-table th.tbe-pref-pinned-start,
.data-table td.tbe-pref-pinned-start {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface, #fff);
}
.data-table th.tbe-pref-pinned-end,
.data-table td.tbe-pref-pinned-end {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface, #fff);
}
.data-table thead th.tbe-pref-pinned-start,
.data-table thead th.tbe-pref-pinned-end { z-index: 4; background: #f1f4f5; }
.data-table tbody tr:hover > .tbe-pref-pinned-start,
.data-table tbody tr:hover > .tbe-pref-pinned-end { background: #f0f7fb; }

@media (max-width: 640px) {
  .tbe-table-preferences-panel { width: calc(100vw - 16px) !important; }
  .tbe-pref-column { grid-template-columns: minmax(64px, 1fr) auto auto; gap: 5px; }
  .tbe-pref-visibility { gap: 3px; }
}
