.workspace-leaf-content[data-type="csv"] .view-content{
  padding:0;
  display: flex;
  flex-direction: column;

  .progress-bar {
    z-index: 500;
    padding: 40px;
  }

  .htMarkdownEditor {
    position: absolute;
    width: auto;
    background: var(--background-primary);

    .markdown-source-view {
      padding:0;
      .CodeMirror-scroll {
        padding:0;
        margin:0;
        padding-bottom:8px;
      }
      .CodeMirror-sizer {
        padding: 0 !important;
        margin: 0 !important;
        border: none;
      }
      .CodeMirror-lines{
        padding: 0;
      }
      .CodeMirror-code{
        padding:0;
      }
    }
  }
  
  .csv-controls {
    margin: 20px 8px 8px 8px;
    padding: 8px;
    background-color: var(--background-primary-alt);
    min-width: 140px;
    max-width: 240px;
    border: 1px solid var(--background-modifier-border);
    border-radius: 6px;
    flex-grow: 0;
    overflow: hidden;
  }
  .csv-table-wrapper {
    position: relative;
    flex-grow: 1;
    width:100%;
  }

  td>p:first-child { margin-top: 0; }
  td>p:last-child { margin-bottom: 0; }
  
  .handsontable.csv-table{
    tbody tr {
      background-color: var(--background-primary);
    }
    tbody tr:nth-child(2n) {
      background-color: var(--background-primary-alt);
    }
    thead tr,
    tbody th {
      background-color: var(--background-secondary);
    }
    tbody th.ht__highlight,
    thead th.ht__highlight {
      background-color: var(--background-secondary-alt);
    }
    tbody th.ht__active_highlight,
    thead th.ht__active_highlight {
      background-color: var(--interactive-accent);
      color:var(--text-on-accent)
    }

    span.colHeader.columnSorting.descending::before {
      background-image: none;
      font-size: 0.75em;
      content: "↓";
    }
    span.colHeader.columnSorting.ascending::before {
      background-image: none;
      font-size: 0.75em;
      content: "↑";
    }

    th,
    td {
      background-color: transparent;
      border-color: var(--background-modifier-border);
      color: var(--text-normal);
    }
    
    &.htRowHeaders thead tr th:nth-child(2),
    tr:first-child th,
    tr:first-child td,
    th:first-child,
    th:nth-child(2),
    td:first-of-type {
      border-color: var(--background-modifier-border);
    }

    .wtBorder,
    td.area:before,
    td.area-1:before,
    td.area-2:before,
    td.area-3:before,
    td.area-4:before,
    td.area-5:before,
    td.area-6:before,
    td.area-7:before {
      background-color: var(--interactive-accent) !important;
    }
  }
}

.htMenu.handsontable {

  .ht_master table td.htCustomMenuRenderer,
  tbody tr {
    background-color: var(--background-primary);
  }

  th,
  td,
  table tbody tr td {
    background-color: transparent;
    border-color: var(--background-modifier-border);
    color: var(--text-normal);
  }
  
  table tbody tr td.htDisabled {
    color: var(--text-faint);
  }
  
  table tbody tr td.htSeparator,
  .ht_master table.htCore {
    border-color: var(--background-modifier-border);
  }
}