/* CSV preview owns its bounded scroll viewport, intrinsic table, sticky header, and resize UI. */
#files-tab .fn-preview-body.fn-csv-preview-host { overflow: hidden; }
#files-tab .fn-csv-scroll {
  width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: auto;
  overscroll-behavior: contain; scrollbar-gutter: stable;
}
#files-tab .fn-preview-table {
  border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px;
}
#files-tab .fn-preview-table th, #files-tab .fn-preview-table td {
  border: 1px solid var(--ui-line-soft); padding: 5px 9px; text-align: left; white-space: nowrap;
}
#files-tab .fn-preview-table th {
  color: var(--ui-muted); font-weight: 600; background-color: var(--ui-bg);
  position: sticky; top: 0; z-index: 3;
}
#files-tab .fn-csv-resize-handle {
  position: absolute; z-index: 2; top: 0; right: -5px; width: 10px; height: 100%;
  cursor: col-resize; touch-action: none;
}
#files-tab .fn-csv-resize-handle::after {
  content: ""; position: absolute; top: 20%; bottom: 20%; left: 4px; width: 2px;
  border-radius: 2px; background: transparent;
}
#files-tab .fn-csv-resize-handle:hover::after,
#files-tab .fn-csv-resize-handle:focus-visible::after,
#files-tab .fn-csv-resize-handle.fn-resizing::after { background: var(--ui-accent); }

@media (max-width: 760px) {
  #files-tab .fn-preview-body.fn-csv-preview-host {
    flex: 0 0 min(60dvh, 520px); height: min(60dvh, 520px); min-height: 320px;
  }
}
