Advanced: understanding wp_add_inline_style function

Check if the following works for you. Just adapt the is_single() to is_singular(‘custom-post-type’) if you want this on a single custom post type template specifically. Hope this helps.

function bootstrap_scripts_styles() {
  wp_enqueue_style('custom-style',get_template_directory_uri() . '/bootstrap.css');
  $custom_css = ".intro { background: red; }";
  wp_add_inline_style( 'custom-style', $custom_css );
}


function enqueue_inline_style( $query ) {
    if ( $query->is_single()) {
        add_action( 'wp_enqueue_scripts', 'bootstrap_scripts_styles' );
    }
}

add_action( 'pre_get_posts', 'enqueue_inline_style' );

edit: obviously just enqueue the main stylesheet separately.