.outputpane {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  border-left: 2px solid $module-color-unreachable;

  &.module-ok {
    border-color: $module-color-ok !important;
  }
  &.module-error {
    border-color: $module-color-error;
  }
  &.module-busy {
    border-color: $module-color-busy;
  }

  .table-switcher {
    height: 100%;
    position: relative;

    & > * {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }

    &.has-loaded .loading-table {
      // Hide the DataGrid of the loading table: we'll show the current table
      // instead.
      //
      // Keep its size: DataGrid should to know its size to load correctly.
      pointer-events: none;
      opacity: 0;
    }

    &.has-loading .loaded-table {
      // Subtly fade out old data. The user doesn't want it.
      opacity: 0.8;
    }
  }

  .outputpane-table {
    height: 100%;
    position: relative;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    background: $table-background;

    .outputpane-data {
      flex: 1 1 auto; // consume maximum height (unlike header, which is fixed-height)
      position: relative;

      // DataGrid is the heaviest DOM tree we have, and it affects the
      // performance of the custom drag layer (and probably everything else). By
      // putting a no-op translate3d property on it, we coerce browsers into
      // rendering it and all of its children in a seperate compositing layer,
      // improving the rendering of everything else in the app.
      transform: translate3d(0, 0, 0);

      .big-table {
        position: absolute;
        max-height: 100%;
        width: 100%;
        height: 100%;
      }

      table {
        border-bottom: 1px solid $table-border;
        border-right: 1px solid $table-border;
      }

      thead th {
        .column-reorder-drop-zone {
          position: absolute;
          top: 0;
          height: 100%;
          width: 0.5rem;
          z-index: 1;

          &.align-left {
            left: -0.25rem;
          }
          &.align-right {
            right: -0.25rem;
          }

          &.dragging-over {
            background-color: $brand-orange;
          }

          &::before {
            // Make a bigger, invisible drop zone: when we drag over this,
            // the user can drop
            content: '';
            position: absolute;
            top: 0;
            height: 100%;
            left: -8rem;
            right: -8rem;
          }
        }

        .resize-handle {
          position: absolute;
          top: 0;
          right: 0;
          height: 100%;
          width: .5rem;
          cursor: ew-resize;
          z-index: 1;
        }

        .column-letter {
          text-align: center;
          padding-top: 0.3rem;
          color: white;
          font-size: 1.2rem;
          cursor: grab;

          &:active {
            background-color: $header-hover;
            cursor: grabbing;
          }
        }

        .column-key {
          .value, .column-type {
            text-overflow: ellipsis;
            white-space: pre; // don't wrap; on all-space colnames, consume 1 line height
            overflow: hidden;
          }

          .value {
            padding: 0 rem(0.625);
            height: rem(1.5);
            line-height: rem(1.5);
            position: relative;

            &.editing {
              overflow: visible;

              & + .column-type {
                visibility: hidden;
              }
            }

            input[name='new-column-key'] {
              position: absolute;
              font: inherit;
              left: 0;
              width: 100%;
              top: rem(-0.375);
              bottom: rem(-0.375);
              padding: 0 calc(#{rem(0.625)} - 2px);
              border: 2px solid $brand-orange;
              border-radius: 5px;

              & + .dropdown {
                display: none;
              }
            }
          }

          .column-type:empty::before {
            content: '\00a0';
          }
        }

        .dropdown {
          position: absolute;
          flex: 0 0 auto;
          display: flex;
          width: 3rem;
          height: 100%;
          justify-content: center;
          align-items: center;
          cursor: pointer;
          opacity: 0;
          z-index: 1;
          right: 1px; // th>* has border-right: 1px
          top: 0;
          bottom: 0;
          border-left: 1px solid $dark-accent--medium;
          background-color: $heading-bg;

          &:hover,
          &.active {
            opacity: 1;
          }

          button {
            flex: 0 0 auto;
            height: 2.5rem;
            width: 2.5rem;
            font-size: 0.7rem;
            border: 0;
            background-color: transparent;
            color: inherit;
            position: relative;
            opacity: 0.9;
            color: $brand-orange;
            &:hover {
              background-color: $brand-orange;
              color: white;
            }
            i {
              margin-left: 1px;
            }
          }
        }
      }

      // Your average cell in the table
      .react-grid-Cell {
        .react-grid-Cell__value > .cell-null {
          // "overflow: hidden" seems to crop the fake-italics 'null' in number cells on
          // Chrome 73 on Mac/Linux. TODO fix the font to correct this problem
          overflow: visible;
        }
      }
    }
  }
}
