.Root {
  display: flex;
  flex-direction: column;
  overflow: hidden;

  &.has-visible-overflow {
    overflow: visible;
  }

  &.is-variant-default {
    background-color: var(--theme-color-bg-2);

    &:not(:last-child) {
      border-bottom: 1px solid var(--theme-color-bg-1);
    }

    &.has-top-divider {
      border-top: 1px solid var(--theme-color-bg-1);
    }
  }

  &.is-variant-panel,
  &.is-variant-panel-shy {
    background-color: var(--theme-color-bg-2);
  }

  &.is-variant-panel-shy {
    &:not(:first-child),
    &.has-top-divider {
      border-top: 1px solid var(--theme-color-bg-1);
    }
  }

  &.is-variant-in-modal {
    background-color: var(--theme-color-bg-4);
  }
}

.Header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  /* consistency */
  flex: 0 0 36px;
  min-height: 36px;
  padding: 0 var(--spacing-2-5) 0 var(--spacing-4);

  user-select: none;

  &.is-variant-panel {
    background-color: var(--theme-color-bg-3);
  }

  &.is-variant-panel-shy {
    background-color: transparent;
  }

  &.is-variant-in-modal {
    background-color: var(--theme-color-bg-3);
  }

  &.is-collapsable {
    padding-right: 0;
    cursor: pointer;

    &:hover {
      background-color: var(--theme-color-bg-hover);
    }
  }
}

.Body {
  /* allow scrolling */
  overflow: hidden overlay;
  padding-top: var(--spacing-2);

  &.is-variant-in-modal {
    padding: 0;
  }

  &.has-visible-overflow {
    overflow: visible;
  }

  &.has-bottom-spacing {
    padding-bottom: var(--spacing-3);
  }

  &.has-gutter {
    padding: var(--spacing-section-padding);
  }

  /* Custom scrollbar styling */
  &::-webkit-scrollbar {
    width: 8px;
  }

  &::-webkit-scrollbar-track {
    background: var(--theme-color-bg-3);
  }

  &::-webkit-scrollbar-thumb {
    background: var(--theme-color-bg-5);
    border-radius: var(--radius-full);

    &:hover {
      background: var(--theme-color-fg-muted);
    }
  }
}
