<?php
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- False positive: locally-scoped variables (template view-vars via TemplateLoader::render() extract+include within a method, or closure locals), not plugin globals.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Getting Started checklist page.
 *
 * @var array $checks
 * @var array $actions
 * @var array $listing_choices
 * @var int   $default_listing_id
 * @var string $default_email
 * @var string $page_url
 * @var string $wizard_url
 * @var bool  $is_pro
 * @var string $integration_mode
 * @var string $site_type
 * @var array $lane_profile
 * @var array $demo_content
 * @var array $quick_steps
 * @var array $shortcode_snippets
 * @var string $support_url
 * @var string $support_docs_url
 * @var string $system_status_url
 * @var string $support_status_url
 * @var string $support_snapshot_url
 * @var string $support_bundle_url
 * @var array $support_touchpoint_actions
 * @var array $generic_validation
 * @var string $generic_validation_url
 * @var array $generic_readiness_summary
 * @var array $wizard_completion
 * @var array $operational_summary_items
 * @var string $operational_summary_url
 * @var string $operational_general_settings_url
 * @var string $operational_notifications_settings_url
 * @var string $single_business_default_provider_url
 * @var string $single_business_pages_url
 * @var array $single_business_status
 * @var array $mylisting_activation_flow
 * @var array $lane_summary
 */
$heading = __( 'MyBookaro Getting Started', 'mybookaro' );
$lane_profile = ( isset( $lane_profile ) && is_array( $lane_profile ) ) ? $lane_profile : [];
$lane_label = (string) ( $lane_profile['label'] ?? '' );
$lane_provider_mapping = (string) ( $lane_profile['provider_mapping'] ?? '' );
$lane_services_model = (string) ( $lane_profile['services_model'] ?? '' );
$lane_placement_model = (string) ( $lane_profile['placement_model'] ?? '' );
$lane_pages_required = (string) ( $lane_profile['pages_required'] ?? '' );
$subheading = ( 'single_business' === ( $lane_profile['id'] ?? '' ) )
    ? __( 'Single Business fast path (no listings required): set Default Provider, assign pages, create first service, then preview one complete booking flow.', 'mybookaro' )
    : ( ( 'mylisting_directory' === ( $lane_profile['id'] ?? '' ) )
        ? __( 'MyListing Directory fast path: confirm sidebar booking entry, repeater mapping, and one complete booking flow test.', 'mybookaro' )
        : __( 'Generic Directory fast path: confirm mapping, services model, placement strategy, page assignments, then complete one end-to-end booking test.', 'mybookaro' ) );
$mode_label = $lane_label !== ''
    ? sprintf(
        /* translators: %s: product lane label */
        __( 'Lane detected: %s', 'mybookaro' ),
        $lane_label
    )
    : ( ( $integration_mode ?? '' ) === 'generic'
        ? __( 'Mode detected: Generic', 'mybookaro' )
        : __( 'Mode detected: MyListing', 'mybookaro' ) );
$single_business_mode = ( 'single_business' === ( $site_type ?? '' ) );
$empty_listing_message = ( $integration_mode ?? '' ) === 'generic'
    ? (
        $single_business_mode
            ? __( 'Single Business requires no listings. Set a Default Provider and use booking/services pages for your first test booking.', 'mybookaro' )
            : __( 'No listings found for selected post types. Open Settings > General, select listing post types, create a listing, then retry.', 'mybookaro' )
    )
    : __( 'No MyListing listings found yet. Create a listing in MyListing, then return and retry.', 'mybookaro' );
$settings_url = admin_url( 'admin.php?page=bookaro-booking-settings&tab=general' );
$wizard_label = __( 'Run setup wizard', 'mybookaro' );
$generic_validation = ( isset( $generic_validation ) && is_array( $generic_validation ) ) ? $generic_validation : [];
$system_status_url = ! empty( $system_status_url )
    ? (string) $system_status_url
    : admin_url( 'admin.php?page=bookaro-system-status' );
$generic_validation_url = ! empty( $generic_validation_url )
    ? (string) $generic_validation_url
    : $system_status_url . '#bookaro-support-check-generic_validation_provider_resolution_sample';
$support_snapshot_url = ! empty( $support_snapshot_url )
    ? (string) $support_snapshot_url
    : ( ! empty( $support_status_url )
        ? (string) $support_status_url
        : $system_status_url . '#bookaro-support-snapshot' );
$support_bundle_url = ! empty( $support_bundle_url )
    ? (string) $support_bundle_url
    : $system_status_url . '#bookaro-support-bundle';
$support_touchpoint_actions = ( isset( $support_touchpoint_actions ) && is_array( $support_touchpoint_actions ) )
    ? $support_touchpoint_actions
    : [
        [
            'label' => __( 'Open masked snapshot first', 'mybookaro' ),
            'url' => $support_snapshot_url,
        ],
        [
            'label' => __( 'Open System Status', 'mybookaro' ),
            'url' => $system_status_url,
        ],
        [
            'label' => __( 'Open Support Bundle (if requested)', 'mybookaro' ),
            'url' => $support_bundle_url,
        ],
    ];
$generic_readiness_summary = ( isset( $generic_readiness_summary ) && is_array( $generic_readiness_summary ) ) ? $generic_readiness_summary : [];
$operational_summary_items = ( isset( $operational_summary_items ) && is_array( $operational_summary_items ) ) ? $operational_summary_items : [];
$operational_summary_url = ! empty( $operational_summary_url )
    ? (string) $operational_summary_url
    : ( ! empty( $page_url ) ? ( (string) $page_url . '#bookaro-operational-summary' ) : '#bookaro-operational-summary' );
$operational_general_settings_url = ! empty( $operational_general_settings_url )
    ? (string) $operational_general_settings_url
    : admin_url( 'admin.php?page=bookaro-booking-settings&tab=general' );
$operational_notifications_settings_url = ! empty( $operational_notifications_settings_url )
    ? (string) $operational_notifications_settings_url
    : admin_url( 'admin.php?page=bookaro-booking-settings&tab=notifications' );
$single_business_default_provider_url = ! empty( $single_business_default_provider_url )
    ? (string) $single_business_default_provider_url
    : admin_url( 'admin.php?page=bookaro-setup-wizard&step=listings' );
$single_business_pages_url = ! empty( $single_business_pages_url )
    ? (string) $single_business_pages_url
    : admin_url( 'admin.php?page=bookaro-setup-wizard&step=pages' );
$single_business_status = ( isset( $single_business_status ) && is_array( $single_business_status ) ) ? $single_business_status : [];
$single_business_provider_ready = ! empty( $single_business_status['provider_ready'] );
$single_business_pages_ready = ! empty( $single_business_status['pages_ready'] );
$single_business_services_ready = ! empty( $single_business_status['services_ready'] );
$single_business_preview_ready = ! empty( $single_business_status['preview_ready'] );
$single_business_create_service_url = ! empty( $single_business_status['create_service_url'] )
    ? (string) $single_business_status['create_service_url']
    : admin_url( 'post-new.php?post_type=' . ( defined( 'BOOKARO_SERVICE_POST_TYPE' ) ? BOOKARO_SERVICE_POST_TYPE : 'bookaro_service' ) );
$single_business_preview_url = ! empty( $single_business_status['preview_url'] )
    ? (string) $single_business_status['preview_url']
    : '#bookaro-action-open-listing';
$single_business_pages_action_label = (string) ( $single_business_status['pages_action_label'] ?? __( 'Assign pages', 'mybookaro' ) );
$single_business_pages_action_label = '' !== trim( $single_business_pages_action_label ) ? $single_business_pages_action_label : __( 'Assign pages', 'mybookaro' );
$single_business_provider_action_label = $single_business_provider_ready ? __( 'Review Default Provider', 'mybookaro' ) : __( 'Set Default Provider', 'mybookaro' );
$single_business_preview_action_label = ! $single_business_provider_ready
    ? __( 'Set Default Provider', 'mybookaro' )
    : (
        ! $single_business_pages_ready
            ? $single_business_pages_action_label
            : (
                ! $single_business_services_ready
                    ? __( 'Create first service', 'mybookaro' )
                    : __( 'Open booking/services preview', 'mybookaro' )
            )
    );
$single_business_preview_action_url = ! $single_business_provider_ready
    ? $single_business_default_provider_url
    : (
        ! $single_business_pages_ready
            ? $single_business_pages_url
            : (
                ! $single_business_services_ready
                    ? $single_business_create_service_url
                    : $single_business_preview_url
            )
    );
$single_business_steps_description = sprintf(
    /* translators: 1: default provider URL, 2: pages URL, 3: create service URL, 4: preview URL */
    __( 'Single Business requires no listings. Follow this order: <a href="%1$s">Default Provider</a> -> <a href="%2$s">booking/customer/provider pages</a> -> <a href="%3$s">first service</a> -> <a href="%4$s">preview booking flow</a>.', 'mybookaro' ),
    esc_url( $single_business_default_provider_url ),
    esc_url( $single_business_pages_url ),
    esc_url( $single_business_create_service_url ),
    esc_url( $single_business_preview_url )
);
$mylisting_activation_flow = ( isset( $mylisting_activation_flow ) && is_array( $mylisting_activation_flow ) ) ? $mylisting_activation_flow : [];
$mylisting_activation_flow = wp_parse_args(
    $mylisting_activation_flow,
    [
        'active' => false,
        'milestones' => [],
        'completed' => 0,
        'total' => 0,
        'next_action' => [
            'label' => '',
            'url' => '',
            'detail' => '',
        ],
    ]
);
$mylisting_next_action = ( isset( $mylisting_activation_flow['next_action'] ) && is_array( $mylisting_activation_flow['next_action'] )
    ? $mylisting_activation_flow['next_action']
    : [ 'label' => '', 'url' => '', 'detail' => '' ] );
$lane_summary = ( isset( $lane_summary ) && is_array( $lane_summary ) ) ? $lane_summary : [];
$wizard_completion = ( isset( $wizard_completion ) && is_array( $wizard_completion ) ) ? $wizard_completion : [];
$wizard_completion = wp_parse_args(
    $wizard_completion,
    [
        'active' => false,
        'lane_id' => '',
        'title' => '',
        'state' => 'info',
        'state_label' => __( 'Info', 'mybookaro' ),
        'summary' => '',
        'next_steps' => [],
        'actions' => [],
    ]
);
$wizard_completion_state = sanitize_key( (string) ( $wizard_completion['state'] ?? 'info' ) );
if ( ! in_array( $wizard_completion_state, [ 'ok', 'warn', 'error', 'info' ], true ) ) {
    $wizard_completion_state = 'info';
}
$wizard_completion_state_label = (string) ( $wizard_completion['state_label'] ?? __( 'Info', 'mybookaro' ) );
$wizard_completion_next_steps = [];
foreach ( (array) ( $wizard_completion['next_steps'] ?? [] ) as $wizard_completion_next_step ) {
    $wizard_completion_next_step = trim( (string) $wizard_completion_next_step );
    if ( '' === $wizard_completion_next_step ) {
        continue;
    }
    $wizard_completion_next_steps[] = $wizard_completion_next_step;
}
$wizard_completion_actions = ( isset( $wizard_completion['actions'] ) && is_array( $wizard_completion['actions'] ) )
    ? $wizard_completion['actions']
    : [];
$generic_readiness_state = sanitize_key( (string) ( $generic_readiness_summary['state'] ?? 'info' ) );
if ( ! in_array( $generic_readiness_state, [ 'ok', 'warn', 'error', 'info' ], true ) ) {
    $generic_readiness_state = 'info';
}
$generic_readiness_state_label = (string) ( $generic_readiness_summary['state_label'] ?? __( 'Info', 'mybookaro' ) );
$generic_readiness_validation_level = sanitize_key( (string) ( $generic_readiness_summary['validation_state_level'] ?? 'info' ) );
if ( ! in_array( $generic_readiness_validation_level, [ 'ok', 'warn', 'error', 'info' ], true ) ) {
    $generic_readiness_validation_level = 'info';
}
$generic_validation_total = absint( $generic_validation['total'] ?? 0 );
$generic_validation_failed = absint( $generic_validation['failed'] ?? 0 );
if ( ( $integration_mode ?? '' ) === 'generic' ) {
    if ( $generic_validation_total < 1 ) {
        $generic_validation_summary = __( 'Run System Status validation to get pass/warn/fail checks for your setup.', 'mybookaro' );
    } elseif ( $generic_validation_failed > 0 ) {
        $generic_validation_summary = sprintf(
            /* translators: 1: failed checks, 2: total checks */
            __( '%1$d of %2$d checks need attention (Warn/Fail).', 'mybookaro' ),
            $generic_validation_failed,
            $generic_validation_total
        );
    } else {
        $generic_validation_summary = sprintf(
            /* translators: %d: total checks */
            __( 'All %d checks are passing.', 'mybookaro' ),
            $generic_validation_total
        );
    }
}
$render_support_touchpoint_actions = static function ( array $actions, string $button_class = 'button button-small' ): void {
    $rendered = false;
    foreach ( $actions as $action ) {
        if ( ! is_array( $action ) ) {
            continue;
        }
        if ( empty( $action['url'] ) || empty( $action['label'] ) ) {
            continue;
        }
        if ( ! $rendered ) {
            echo '<div class="bookaro-status-item__actions">';
            $rendered = true;
        }
        echo '<a class="' . esc_attr( $button_class ) . '" href="' . esc_url( (string) $action['url'] ) . '">';
        echo esc_html( (string) $action['label'] );
        echo '</a>';
    }
    if ( $rendered ) {
        echo '</div>';
    }
};
?>
<div class="wrap bookaro-admin bookaro-getting-started">
    <div class="bookaro-card bookaro-hero bookaro-getting-started__hero">
        <div class="bookaro-hero__content">
            <div class="bookaro-hero__brand">
                <img src="<?php echo esc_url( BOOKARO_PLUGIN_URL . 'assets/img/mb-logo.svg' ); ?>" alt="<?php esc_attr_e( 'MyBookaro', 'mybookaro' ); ?>" width="120" height="36" />
            </div>
            <h1><?php echo esc_html( $heading ); ?></h1>
            <p class="description"><?php echo esc_html( $subheading ); ?></p>
            <div class="bookaro-mode-pill"><?php echo esc_html( $mode_label ); ?></div>
        </div>
        <div class="bookaro-hero__actions">
            <?php if ( ( $integration_mode ?? '' ) === 'mylisting' && ! empty( $mylisting_next_action['url'] ) && ! empty( $mylisting_next_action['label'] ) ) : ?>
                <a class="button button-primary" href="<?php echo esc_url( (string) $mylisting_next_action['url'] ); ?>">
                    <?php echo esc_html( (string) $mylisting_next_action['label'] ); ?>
                </a>
            <?php endif; ?>
            <a class="button button-secondary" href="<?php echo esc_url( $settings_url ); ?>">
                <?php esc_html_e( 'Open settings', 'mybookaro' ); ?>
            </a>
            <?php if ( in_array( ( $integration_mode ?? '' ), [ 'generic', 'mylisting' ], true ) ) : ?>
                <a class="button <?php echo esc_attr( ( $integration_mode ?? '' ) === 'mylisting' ? 'button-secondary' : 'button-primary' ); ?>" href="<?php echo esc_url( $wizard_url ?? admin_url( 'admin.php?page=bookaro-setup-wizard' ) ); ?>">
                    <?php echo esc_html( $wizard_label ); ?>
                </a>
            <?php endif; ?>
            <?php if ( ( $integration_mode ?? '' ) === 'generic' ) : ?>
                <a class="button button-secondary" href="<?php echo esc_url( $generic_validation_url ); ?>">
                    <?php esc_html_e( 'Run System Status validation', 'mybookaro' ); ?>
                </a>
            <?php endif; ?>
            <?php if ( $single_business_mode ) : ?>
                <a class="button button-secondary" href="<?php echo esc_url( $single_business_default_provider_url ); ?>">
                    <?php echo esc_html( $single_business_provider_action_label ); ?>
                </a>
                <a class="button button-secondary" href="<?php echo esc_url( $single_business_pages_url ); ?>">
                    <?php echo esc_html( $single_business_pages_action_label ); ?>
                </a>
                <a class="button button-secondary" href="<?php echo esc_url( $single_business_create_service_url ); ?>">
                    <?php esc_html_e( 'Create first service', 'mybookaro' ); ?>
                </a>
                <a class="button <?php echo esc_attr( $single_business_preview_ready ? 'button-primary' : 'button-secondary' ); ?>" href="<?php echo esc_url( $single_business_preview_action_url ); ?>">
                    <?php echo esc_html( $single_business_preview_action_label ); ?>
                </a>
            <?php endif; ?>
            <?php foreach ( $support_touchpoint_actions as $support_touchpoint_action ) : ?>
                <a class="button button-secondary" href="<?php echo esc_url( (string) ( $support_touchpoint_action['url'] ?? '' ) ); ?>">
                    <?php echo esc_html( (string) ( $support_touchpoint_action['label'] ?? '' ) ); ?>
                </a>
            <?php endforeach; ?>
            <?php if ( ! empty( $operational_summary_items ) ) : ?>
                <a class="button button-secondary" href="<?php echo esc_url( $operational_summary_url ); ?>">
                    <?php esc_html_e( 'Open operational summary', 'mybookaro' ); ?>
                </a>
            <?php endif; ?>
        </div>
        <?php if ( ( $integration_mode ?? '' ) === 'mylisting' && ! empty( $mylisting_next_action['detail'] ) ) : ?>
            <p class="description"><?php echo esc_html( (string) $mylisting_next_action['detail'] ); ?></p>
        <?php endif; ?>
        <?php if ( $single_business_mode ) : ?>
            <p class="description">
                <?php
                echo wp_kses_post( $single_business_steps_description );
                ?>
            </p>
        <?php endif; ?>
        <p class="description">
            <?php
            printf(
                /* translators: %1$s: dynamic string, %2$s: dynamic string */
                wp_kses_post( __( 'Support handoff: start with the <a href="%1$s">masked support snapshot</a>. Share the <a href="%2$s">Support Bundle</a> only when support asks for deeper diagnostics.', 'mybookaro' ) ),
                esc_url( $support_snapshot_url ),
                esc_url( $support_bundle_url )
            );
            ?>
        </p>
        <?php if ( ! empty( $operational_summary_items ) ) : ?>
            <p class="description">
                <?php
                printf(
                    /* translators: %s: dynamic string */
                    wp_kses_post( __( 'Before launch, review the <a href="%s">operational summary</a> so safeguards, reminders, review invites, and lifecycle defaults are confirmed.', 'mybookaro' ) ),
                    esc_url( $operational_summary_url )
                );
                ?>
            </p>
        <?php endif; ?>
    </div>

    <?php \Bookaro\Utils\TemplateLoader::render( 'admin/components/lane-summary-banner.php', [ 'lane_summary' => $lane_summary ] ); ?>

    <?php if ( ! empty( $wizard_completion['active'] ) ) : ?>
        <div class="bookaro-card bookaro-getting-started__card" id="bookaro-wizard-completion">
            <div class="bookaro-card__header">
                <h2><?php echo esc_html( (string) ( $wizard_completion['title'] ?? __( 'Setup complete', 'mybookaro' ) ) ); ?></h2>
                <?php if ( ! empty( $wizard_completion['summary'] ) ) : ?>
                    <p class="description"><?php echo esc_html( (string) $wizard_completion['summary'] ); ?></p>
                <?php endif; ?>
            </div>
            <div class="bookaro-status-list">
                <div class="bookaro-status-item">
                    <div class="bookaro-status-item__label"><?php esc_html_e( 'Completion state', 'mybookaro' ); ?></div>
                    <div class="bookaro-status-item__value">
                        <span class="bookaro-status-pill <?php echo esc_attr( 'bookaro-status-pill--' . $wizard_completion_state ); ?>">
                            <?php echo esc_html( $wizard_completion_state_label ); ?>
                        </span>
                    </div>
                </div>
                <?php if ( ! empty( $wizard_completion_next_steps ) ) : ?>
                    <div class="bookaro-status-item">
                        <div class="bookaro-status-item__label"><?php esc_html_e( 'Next steps', 'mybookaro' ); ?></div>
                        <div class="bookaro-status-item__value">
                            <ul class="bookaro-tip-list">
                                <?php foreach ( $wizard_completion_next_steps as $wizard_completion_next_step ) : ?>
                                    <li><?php echo esc_html( (string) $wizard_completion_next_step ); ?></li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                    </div>
                <?php endif; ?>
            </div>
            <?php $render_support_touchpoint_actions( $wizard_completion_actions ); ?>
        </div>
    <?php endif; ?>

    <div class="bookaro-card bookaro-getting-started__card">
        <div class="bookaro-card__header">
            <h2><?php esc_html_e( 'Lane blueprint', 'mybookaro' ); ?></h2>
            <p class="description"><?php esc_html_e( 'Use this as the expected setup checklist for your active product lane.', 'mybookaro' ); ?></p>
        </div>
        <div class="bookaro-status-list">
            <div class="bookaro-status-item">
                <div class="bookaro-status-item__label"><?php esc_html_e( 'Provider mapping', 'mybookaro' ); ?></div>
                <div class="bookaro-status-item__value"><?php echo esc_html( $lane_provider_mapping ); ?></div>
            </div>
            <div class="bookaro-status-item">
                <div class="bookaro-status-item__label"><?php esc_html_e( 'Services model', 'mybookaro' ); ?></div>
                <div class="bookaro-status-item__value"><?php echo esc_html( $lane_services_model ); ?></div>
            </div>
            <div class="bookaro-status-item">
                <div class="bookaro-status-item__label"><?php esc_html_e( 'Placement model', 'mybookaro' ); ?></div>
                <div class="bookaro-status-item__value"><?php echo esc_html( $lane_placement_model ); ?></div>
            </div>
            <div class="bookaro-status-item">
                <div class="bookaro-status-item__label"><?php esc_html_e( 'Pages and dashboards', 'mybookaro' ); ?></div>
                <div class="bookaro-status-item__value"><?php echo esc_html( $lane_pages_required ); ?></div>
            </div>
        </div>
    </div>

    <?php if ( ! empty( $operational_summary_items ) ) : ?>
        <div class="bookaro-card bookaro-getting-started__card" id="bookaro-operational-summary">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Operational guardrails', 'mybookaro' ); ?></h2>
                <p class="description"><?php esc_html_e( 'Read-only summary of default safeguards and active behavior for anti-spam, booking windows, reminders, and lifecycle automations.', 'mybookaro' ); ?></p>
            </div>
            <div class="bookaro-status-list">
                <?php foreach ( $operational_summary_items as $item ) : ?>
                    <div class="bookaro-status-item">
                        <div class="bookaro-status-item__label"><?php echo esc_html( (string) ( $item['label'] ?? '' ) ); ?></div>
                        <div class="bookaro-status-item__value">
                            <?php echo esc_html( (string) ( $item['active'] ?? '' ) ); ?>
                            <?php if ( ! empty( $item['default'] ) ) : ?>
                                <div class="bookaro-status-item__meta">
                                    <?php
                                    echo esc_html(
                                        sprintf(
                                            /* translators: %s: shipped default setting summary */
                                            __( 'Shipped default: %s', 'mybookaro' ),
                                            (string) $item['default']
                                        )
                                    );
                                    ?>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
            <div class="bookaro-status-item__actions">
                <a class="button button-small" href="<?php echo esc_url( $operational_general_settings_url ); ?>">
                    <?php esc_html_e( 'Open General settings', 'mybookaro' ); ?>
                </a>
                <a class="button button-small" href="<?php echo esc_url( $operational_notifications_settings_url ); ?>">
                    <?php esc_html_e( 'Open Notifications settings', 'mybookaro' ); ?>
                </a>
            </div>
        </div>
    <?php endif; ?>

    <?php if ( ( $integration_mode ?? '' ) === 'mylisting' && ! empty( $mylisting_activation_flow['active'] ) ) : ?>
        <div class="bookaro-card bookaro-getting-started__card" id="bookaro-first-booking-progress">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'First booking progress', 'mybookaro' ); ?></h2>
                <p class="description">
                    <?php
                    echo esc_html(
                        sprintf(
                            /* translators: 1: completed milestones, 2: total milestones */
                            __( '%1$d of %2$d milestones completed.', 'mybookaro' ),
                            absint( $mylisting_activation_flow['completed'] ?? 0 ),
                            absint( $mylisting_activation_flow['total'] ?? 0 )
                        )
                    );
                    ?>
                </p>
            </div>
            <div class="bookaro-status-list">
                <?php foreach ( (array) ( $mylisting_activation_flow['milestones'] ?? [] ) as $milestone ) : ?>
                    <?php
                    $milestone_passed = ! empty( $milestone['passed'] );
                    $milestone_state = $milestone_passed ? 'ok' : 'warn';
                    $milestone_label = $milestone_passed ? __( 'Ready', 'mybookaro' ) : __( 'Pending', 'mybookaro' );
                    ?>
                    <div class="bookaro-status-item">
                        <div class="bookaro-status-item__label"><?php echo esc_html( (string) ( $milestone['label'] ?? '' ) ); ?></div>
                        <div class="bookaro-status-item__value">
                            <span class="bookaro-status-pill <?php echo esc_attr( 'bookaro-status-pill--' . $milestone_state ); ?>">
                                <?php echo esc_html( $milestone_label ); ?>
                            </span>
                            <?php if ( ! empty( $milestone['detail'] ) ) : ?>
                                <div class="bookaro-status-item__meta"><?php echo esc_html( (string) $milestone['detail'] ); ?></div>
                            <?php endif; ?>
                            <?php if ( empty( $milestone['passed'] ) && ! empty( $milestone['action']['url'] ) && ! empty( $milestone['action']['label'] ) ) : ?>
                                <div class="bookaro-status-item__actions">
                                    <a class="button button-small" href="<?php echo esc_url( (string) $milestone['action']['url'] ); ?>">
                                        <?php echo esc_html( (string) $milestone['action']['label'] ); ?>
                                    </a>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
            <?php $render_support_touchpoint_actions( $support_touchpoint_actions ); ?>
        </div>
    <?php endif; ?>

    <?php if ( ( $integration_mode ?? '' ) === 'generic' && ! empty( $generic_readiness_summary['active'] ) ) : ?>
        <div class="bookaro-card bookaro-getting-started__card" id="bookaro-generic-readiness-summary">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Generic readiness summary', 'mybookaro' ); ?></h2>
                <p class="description"><?php esc_html_e( 'Quick launch snapshot for the Generic Directory lane.', 'mybookaro' ); ?></p>
            </div>
            <div class="bookaro-status-list">
                <div class="bookaro-status-item">
                    <div class="bookaro-status-item__label"><?php esc_html_e( 'Launch readiness', 'mybookaro' ); ?></div>
                    <div class="bookaro-status-item__value">
                        <span class="bookaro-status-pill <?php echo esc_attr( 'bookaro-status-pill--' . $generic_readiness_state ); ?>">
                            <?php echo esc_html( $generic_readiness_state_label ); ?>
                        </span>
                        <?php if ( ! empty( $generic_readiness_summary['current_pattern'] ) ) : ?>
                            <div class="bookaro-status-item__meta">
                                <?php
                                echo esc_html(
                                    sprintf(
                                        /* translators: %s: Generic setup pattern label */
                                        __( 'Current pattern: %s', 'mybookaro' ),
                                        (string) $generic_readiness_summary['current_pattern']
                                    )
                                );
                                ?>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="bookaro-status-item">
                    <div class="bookaro-status-item__label"><?php esc_html_e( 'Validation state', 'mybookaro' ); ?></div>
                    <div class="bookaro-status-item__value">
                        <span class="bookaro-status-pill <?php echo esc_attr( 'bookaro-status-pill--' . $generic_readiness_validation_level ); ?>">
                            <?php echo esc_html( (string) ( $generic_readiness_summary['validation_state'] ?? '' ) ); ?>
                        </span>
                        <?php if ( ! empty( $generic_readiness_summary['validation_detail'] ) ) : ?>
                            <div class="bookaro-status-item__meta"><?php echo esc_html( (string) $generic_readiness_summary['validation_detail'] ); ?></div>
                        <?php endif; ?>
                    </div>
                </div>
                <div class="bookaro-status-item">
                    <div class="bookaro-status-item__label"><?php esc_html_e( 'Last validation run', 'mybookaro' ); ?></div>
                    <div class="bookaro-status-item__value">
                        <div class="bookaro-status-item__meta"><?php echo esc_html( (string) ( $generic_readiness_summary['last_validation_run'] ?? __( 'Never', 'mybookaro' ) ) ); ?></div>
                    </div>
                </div>
                <div class="bookaro-status-item">
                    <div class="bookaro-status-item__label"><?php esc_html_e( 'Top next action', 'mybookaro' ); ?></div>
                    <div class="bookaro-status-item__value">
                        <?php if ( ! empty( $generic_readiness_summary['top_next_action']['detail'] ) ) : ?>
                            <div class="bookaro-status-item__meta"><?php echo esc_html( (string) $generic_readiness_summary['top_next_action']['detail'] ); ?></div>
                        <?php endif; ?>
                        <?php if ( ! empty( $generic_readiness_summary['top_next_action']['url'] ) && ! empty( $generic_readiness_summary['top_next_action']['label'] ) ) : ?>
                            <div class="bookaro-status-item__actions">
                                <a class="button button-small" href="<?php echo esc_url( (string) $generic_readiness_summary['top_next_action']['url'] ); ?>">
                                    <?php echo esc_html( (string) $generic_readiness_summary['top_next_action']['label'] ); ?>
                                </a>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
            <?php $render_support_touchpoint_actions( $support_touchpoint_actions ); ?>
        </div>
    <?php endif; ?>

    <div class="bookaro-overview-grid">
        <div class="bookaro-card bookaro-getting-started__card" id="bookaro-mode-aware-quick-start">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Mode-aware quick start', 'mybookaro' ); ?></h2>
                <p class="description">
                    <?php
                    echo esc_html(
                        $single_business_mode
                            ? __( 'Complete this sequence to launch Single Business quickly: Default Provider, pages, first service, then booking preview.', 'mybookaro' )
                            : ( ( $integration_mode ?? '' ) === 'generic'
                                ? __( 'Complete this lane checklist to confirm mapping, placement, and one booking flow.', 'mybookaro' )
                                : __( 'Complete these streamlined MyListing actions and finish one end-to-end booking test.', 'mybookaro' ) )
                    );
                    ?>
                </p>
            </div>
            <div class="bookaro-onboarding-list">
                <?php foreach ( $quick_steps as $step ) : ?>
                    <?php
                    $passed = ! empty( $step['passed'] );
                    $status_class = $passed ? 'is-success' : 'is-warning';
                    $icon = $passed ? 'dashicons-yes' : 'dashicons-warning';
                    ?>
                    <div class="bookaro-onboarding-item">
                        <div class="bookaro-onboarding-status <?php echo esc_attr( $status_class ); ?>">
                            <span class="dashicons <?php echo esc_attr( $icon ); ?>"></span>
                        </div>
                        <div class="bookaro-onboarding-body">
                            <div class="bookaro-onboarding-title"><?php echo esc_html( $step['label'] ?? '' ); ?></div>
                            <?php if ( ! empty( $step['detail'] ) ) : ?>
                                <div class="description"><?php echo esc_html( $step['detail'] ); ?></div>
                            <?php endif; ?>
                            <?php if ( ! empty( $step['action']['url'] ) && ! empty( $step['action']['label'] ) ) : ?>
                                <div class="bookaro-onboarding-actions">
                                    <a class="button button-secondary" href="<?php echo esc_url( $step['action']['url'] ); ?>">
                                        <?php echo esc_html( $step['action']['label'] ); ?>
                                    </a>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
            <?php $render_support_touchpoint_actions( $support_touchpoint_actions ); ?>
        </div>

        <div class="bookaro-card bookaro-getting-started__card" id="bookaro-onboarding-checklist">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Checklist', 'mybookaro' ); ?></h2>
                <p class="description">
                    <?php
                    echo esc_html(
                        $single_business_mode
                            ? __( 'Read these checks in order to keep the Single Business first-booking path clear and actionable.', 'mybookaro' )
                            : ( ( $integration_mode ?? '' ) === 'generic'
                                ? __( 'Recommended validation checks for Generic mapping, pages, and runtime diagnostics.', 'mybookaro' )
                                : __( 'Recommended final checks for MyListing go-live readiness.', 'mybookaro' ) )
                    );
                    ?>
                </p>
            </div>
            <div class="bookaro-onboarding-list">
                <?php foreach ( $checks as $check ) : ?>
                    <?php
                    $passed = ! empty( $check['passed'] );
                    $status_class = $passed ? 'is-success' : 'is-warning';
                    $icon = $passed ? 'dashicons-yes' : 'dashicons-warning';
                    ?>
                    <div class="bookaro-onboarding-item">
                        <div class="bookaro-onboarding-status <?php echo esc_attr( $status_class ); ?>">
                            <span class="dashicons <?php echo esc_attr( $icon ); ?>"></span>
                        </div>
                        <div class="bookaro-onboarding-body">
                            <div class="bookaro-onboarding-title"><?php echo esc_html( $check['label'] ?? '' ); ?></div>
                            <?php if ( ! empty( $check['detail'] ) ) : ?>
                                <div class="description"><?php echo esc_html( $check['detail'] ); ?></div>
                            <?php endif; ?>
                            <?php if ( ! empty( $check['action']['url'] ) && ! empty( $check['action']['label'] ) ) : ?>
                                <div class="bookaro-onboarding-actions">
                                    <a class="button button-secondary" href="<?php echo esc_url( $check['action']['url'] ); ?>">
                                        <?php echo esc_html( $check['action']['label'] ); ?>
                                    </a>
                                </div>
                            <?php endif; ?>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>

    <div class="bookaro-overview-grid">
        <div class="bookaro-card bookaro-getting-started__card">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Copy shortcodes', 'mybookaro' ); ?></h2>
                <p class="description"><?php esc_html_e( 'Paste these into a page or use the MyBookaro blocks in the editor.', 'mybookaro' ); ?></p>
            </div>
            <div class="bookaro-shortcode-list">
                <?php foreach ( $shortcode_snippets as $snippet ) : ?>
                    <div class="bookaro-shortcode-row">
                        <div class="bookaro-shortcode-label description"><?php echo esc_html( $snippet['label'] ?? '' ); ?></div>
                        <div class="bookaro-shortcode-controls">
                            <input type="text" class="regular-text code" readonly value="<?php echo esc_attr( $snippet['code'] ?? '' ); ?>">
                            <button type="button" class="button bookaro-copy-shortcode" data-copy="<?php echo esc_attr( $snippet['code'] ?? '' ); ?>">
                                <?php esc_html_e( 'Copy', 'mybookaro' ); ?>
                            </button>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
            <p class="description bookaro-shortcode-note">
                <?php esc_html_e( 'Need more? Visit Settings > Shortcodes for the full library.', 'mybookaro' ); ?>
            </p>
        </div>

        <div class="bookaro-card bookaro-getting-started__card">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Integration tips', 'mybookaro' ); ?></h2>
                <p class="description"><?php esc_html_e( 'Recommendations based on your integration mode.', 'mybookaro' ); ?></p>
            </div>
            <?php if ( ( $integration_mode ?? '' ) === 'mylisting' ) : ?>
                <p>
                    <?php
                    printf(
                        wp_kses_post(
                            /* translators: %s: Row CSS Class value */
                            __( 'In MyListing > Listing Type > Repeater, set <strong>Row CSS Class</strong> to <code>%s</code> so MyBookaro can read services.', 'mybookaro' )
                        ),
                        esc_html( (string) ( $repeater_class ?? 'mybookaro_services' ) )
                    );
                    ?>
                </p>
                <p class="description"><?php esc_html_e( 'If you customized the repeater class or prefix, update it in MyBookaro > Settings > General.', 'mybookaro' ); ?></p>
            <?php else : ?>
                <ul class="bookaro-tip-list">
                    <li><?php esc_html_e( 'Step 1: Choose a preset so provider mapping and service assumptions match your site.', 'mybookaro' ); ?></li>
                    <li><?php esc_html_e( 'Step 2: Assign booking/dashboard pages.', 'mybookaro' ); ?></li>
                    <li><?php esc_html_e( 'Step 3: Place Booking Button/Services Cards blocks or shortcodes.', 'mybookaro' ); ?></li>
                    <li><?php esc_html_e( 'Step 4: Run System Status validation and clear Warn/Fail checks.', 'mybookaro' ); ?></li>
                    <li><?php esc_html_e( 'Step 5: Test one booking end-to-end.', 'mybookaro' ); ?></li>
                </ul>
                <p class="description"><?php esc_html_e( 'Use auto-insert only as a fallback when explicit block/shortcode placement is not possible.', 'mybookaro' ); ?></p>
            <?php endif; ?>
            <p class="description"><?php esc_html_e( 'Need blocks or shortcodes? Visit Settings > Shortcodes for copy-ready snippets.', 'mybookaro' ); ?></p>
            <?php
            $custom_forms_url = admin_url( 'admin.php?page=bookaro-custom-forms' );
            $upgrade_url = function_exists( 'bookaro_get_upgrade_url' ) ? (string) bookaro_get_upgrade_url() : '';
            ?>
            <?php if ( $is_pro ) : ?>
                <p class="description">
                    <?php
                    printf(
                        /* translators: %s: dynamic string */
                        wp_kses_post( __( 'Pro tip: Build custom booking fields and profiles in <a href="%s">Custom Forms</a>.', 'mybookaro' ) ),
                        esc_url( $custom_forms_url )
                    );
                    ?>
                </p>
            <?php elseif ( $upgrade_url ) : ?>
                <p class="description">
                    <?php
                    printf(
                        /* translators: %s: dynamic string */
                        wp_kses_post( __( 'Available in MyBookaro Pro. <a href="%s" target="_blank" rel="noopener">Take WooCommerce payments, track payout split, sync provider calendars, automate follow-ups, and export booking operations data.</a>', 'mybookaro' ) ),
                        esc_url( $upgrade_url )
                    );
                    ?>
                </p>
            <?php endif; ?>
        </div>
    </div>

    <div class="bookaro-card bookaro-getting-started__actions">
        <div class="bookaro-card__header">
            <h2><?php esc_html_e( 'Quick actions', 'mybookaro' ); ?></h2>
            <p class="description"><?php esc_html_e( 'Run common setup tasks without leaving this page.', 'mybookaro' ); ?></p>
        </div>
        <div class="bookaro-action-list">
            <div class="bookaro-action-card" id="bookaro-action-demo-content">
                <div class="bookaro-action-card__header">
                    <h3><?php echo esc_html( $actions['demo_content_create']['label'] ?? '' ); ?></h3>
                    <p class="description">
                        <?php if ( ( $integration_mode ?? '' ) === 'generic' && $single_business_mode ) : ?>
                            <?php esc_html_e( 'Adds demo booking/services pages and seeds sample provider services for your default provider.', 'mybookaro' ); ?>
                        <?php elseif ( ( $integration_mode ?? '' ) === 'generic' ) : ?>
                            <?php esc_html_e( 'Adds demo pages + sample services (admin catalog).', 'mybookaro' ); ?>
                        <?php else : ?>
                            <?php esc_html_e( 'Adds demo booking/services pages and seeds sample services for the selected listing when needed.', 'mybookaro' ); ?>
                        <?php endif; ?>
                    </p>
                </div>
                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
                    <?php wp_nonce_field( 'bookaro_getting_started_demo_content_create' ); ?>
                    <input type="hidden" name="action" value="bookaro_getting_started_demo_content_create">
                    <div class="bookaro-action-row">
                        <?php if ( ! empty( $listing_choices ) ) : ?>
                            <select name="listing_id" class="bookaro-action-select">
                                <?php foreach ( $listing_choices as $choice ) : ?>
                                    <option value="<?php echo esc_attr( $choice['id'] ); ?>" <?php selected( (int) $choice['id'], (int) $default_listing_id ); ?>>
                                        <?php echo esc_html( $choice['title'] ?: __( 'Untitled listing', 'mybookaro' ) ); ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        <?php endif; ?>
                        <button type="submit" class="button button-primary" <?php disabled( empty( $actions['demo_content_create']['enabled'] ) ); ?>>
                            <?php esc_html_e( 'Create demo content', 'mybookaro' ); ?>
                        </button>
                    </div>
                    <div class="bookaro-action-meta">
                        <?php echo esc_html__( 'Last run:', 'mybookaro' ) . ' ' . esc_html( $actions['demo_content_create']['last_run'] ?? '' ); ?>
                    </div>
                </form>
                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" class="bookaro-action-secondary">
                    <?php wp_nonce_field( 'bookaro_getting_started_demo_content_remove' ); ?>
                    <input type="hidden" name="action" value="bookaro_getting_started_demo_content_remove">
                    <div class="bookaro-action-row">
                        <button type="submit" class="button button-secondary" <?php disabled( empty( $actions['demo_content_remove']['enabled'] ) ); ?>>
                            <?php esc_html_e( 'Remove demo content', 'mybookaro' ); ?>
                        </button>
                        <span class="bookaro-action-meta">
                            <?php echo esc_html__( 'Last run:', 'mybookaro' ) . ' ' . esc_html( $actions['demo_content_remove']['last_run'] ?? '' ); ?>
                        </span>
                    </div>
                </form>
            </div>

            <div class="bookaro-action-card" id="bookaro-action-demo-timeslots">
                <div class="bookaro-action-card__header">
                    <h3><?php echo esc_html( $actions['demo_timeslots']['label'] ?? '' ); ?></h3>
                    <p class="description"><?php esc_html_e( 'Populate a provider with sample availability so you can test bookings immediately.', 'mybookaro' ); ?></p>
                </div>
                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
                    <?php wp_nonce_field( 'bookaro_getting_started_demo_timeslots' ); ?>
                    <input type="hidden" name="action" value="bookaro_getting_started_demo_timeslots">
                    <div class="bookaro-action-row">
                        <?php if ( ! empty( $listing_choices ) ) : ?>
                            <select name="listing_id" class="bookaro-action-select">
                                <?php foreach ( $listing_choices as $choice ) : ?>
                                    <option value="<?php echo esc_attr( $choice['id'] ); ?>" <?php selected( (int) $choice['id'], (int) $default_listing_id ); ?>>
                                        <?php echo esc_html( $choice['title'] ?: __( 'Untitled listing', 'mybookaro' ) ); ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        <?php else : ?>
                            <span class="description"><?php echo esc_html( $empty_listing_message ); ?></span>
                        <?php endif; ?>
                        <button type="submit" class="button button-primary"><?php esc_html_e( 'Create demo timeslots', 'mybookaro' ); ?></button>
                    </div>
                    <div class="bookaro-action-meta">
                        <?php echo esc_html__( 'Last run:', 'mybookaro' ) . ' ' . esc_html( $actions['demo_timeslots']['last_run'] ?? '' ); ?>
                    </div>
                </form>
            </div>

            <div class="bookaro-action-card" id="bookaro-action-open-listing">
                <div class="bookaro-action-card__header">
                    <h3><?php echo esc_html( $actions['open_listing']['label'] ?? '' ); ?></h3>
                    <p class="description">
                        <?php
                        echo esc_html(
                            $single_business_mode && ( $integration_mode ?? '' ) === 'generic'
                                ? __( 'Open your booking/services page to confirm provider-first booking UI is visible.', 'mybookaro' )
                                : __( 'Preview a listing to confirm the booking UI is visible.', 'mybookaro' )
                        );
                        ?>
                    </p>
                </div>
                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
                    <?php wp_nonce_field( 'bookaro_getting_started_open_listing' ); ?>
                    <input type="hidden" name="action" value="bookaro_getting_started_open_listing">
                    <div class="bookaro-action-row">
                        <?php if ( ! empty( $listing_choices ) ) : ?>
                            <select name="listing_id" class="bookaro-action-select">
                                <?php foreach ( $listing_choices as $choice ) : ?>
                                    <option value="<?php echo esc_attr( $choice['id'] ); ?>" <?php selected( (int) $choice['id'], (int) $default_listing_id ); ?>>
                                        <?php echo esc_html( $choice['title'] ?: __( 'Untitled listing', 'mybookaro' ) ); ?>
                                    </option>
                                <?php endforeach; ?>
                            </select>
                        <?php else : ?>
                            <span class="description"><?php echo esc_html( $empty_listing_message ); ?></span>
                        <?php endif; ?>
                        <button type="submit" class="button button-secondary">
                            <?php echo esc_html( $single_business_mode && ( $integration_mode ?? '' ) === 'generic' ? __( 'Open booking page', 'mybookaro' ) : __( 'Open listing', 'mybookaro' ) ); ?>
                        </button>
                    </div>
                    <div class="bookaro-action-meta">
                        <?php echo esc_html__( 'Last run:', 'mybookaro' ) . ' ' . esc_html( $actions['open_listing']['last_run'] ?? '' ); ?>
                    </div>
                </form>
            </div>

            <div class="bookaro-action-card" id="bookaro-action-test-email">
                <div class="bookaro-action-card__header">
                    <h3><?php echo esc_html( $actions['test_email']['label'] ?? '' ); ?></h3>
                    <p class="description"><?php esc_html_e( 'Verify that emails deliver successfully to your inbox.', 'mybookaro' ); ?></p>
                </div>
                <form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
                    <?php wp_nonce_field( 'bookaro_getting_started_test_email' ); ?>
                    <input type="hidden" name="action" value="bookaro_getting_started_test_email">
                    <div class="bookaro-action-row">
                        <input type="email" name="bookaro_test_email" value="<?php echo esc_attr( $default_email ); ?>" placeholder="<?php esc_attr_e( 'you@example.com', 'mybookaro' ); ?>" class="bookaro-action-input">
                        <button type="submit" class="button button-secondary"><?php esc_html_e( 'Send test email', 'mybookaro' ); ?></button>
                    </div>
                    <div class="bookaro-action-meta">
                        <?php echo esc_html__( 'Last run:', 'mybookaro' ) . ' ' . esc_html( $actions['test_email']['last_run'] ?? '' ); ?>
                    </div>
                </form>
                <?php if ( $is_pro ) : ?>
                    <p class="description bookaro-action-note">
                        <?php esc_html_e( 'Pro tip: You can also run SMS and webhook tests from Settings > Messages/Webhooks.', 'mybookaro' ); ?>
                    </p>
                <?php endif; ?>
            </div>
        </div>
    </div>

    <div class="bookaro-overview-grid">
        <div class="bookaro-card bookaro-getting-started__card bookaro-support">
            <div class="bookaro-card__header">
                <h2><?php esc_html_e( 'Launch & support shortcuts', 'mybookaro' ); ?></h2>
                <p class="description"><?php esc_html_e( 'Use these existing tools before go-live and before opening support requests.', 'mybookaro' ); ?></p>
            </div>
            <div class="bookaro-support__list">
                <?php if ( ! empty( $operational_summary_items ) ) : ?>
                    <div class="bookaro-support__item">
                        <div class="bookaro-support__label"><?php esc_html_e( 'Operational summary', 'mybookaro' ); ?></div>
                        <p class="description bookaro-support__message"><?php esc_html_e( 'Review current safeguards, buffers, reminders, review invites, and lifecycle defaults from the Operational guardrails summary on this page.', 'mybookaro' ); ?></p>
                        <a class="button button-small" href="<?php echo esc_url( $operational_summary_url ); ?>">
                            <?php esc_html_e( 'Review operational summary', 'mybookaro' ); ?>
                        </a>
                    </div>
                <?php endif; ?>

                <?php if ( $single_business_mode ) : ?>
                    <div class="bookaro-support__item">
                        <div class="bookaro-support__label"><?php esc_html_e( 'Single Business no-listing path', 'mybookaro' ); ?></div>
                        <p class="description bookaro-support__message"><?php esc_html_e( 'No listings required. Sequence: Set Default Provider -> assign booking/services/dashboard pages -> create first service -> preview one booking flow.', 'mybookaro' ); ?></p>
                        <div class="bookaro-status-item__actions">
                            <a class="button button-small" href="<?php echo esc_url( $single_business_default_provider_url ); ?>">
                                <?php esc_html_e( 'Review Default Provider', 'mybookaro' ); ?>
                            </a>
                            <a class="button button-small" href="<?php echo esc_url( $single_business_pages_url ); ?>">
                                <?php esc_html_e( 'Assign pages', 'mybookaro' ); ?>
                            </a>
                        </div>
                    </div>
                <?php endif; ?>

                <div class="bookaro-support__item">
                    <div class="bookaro-support__label"><?php esc_html_e( 'Masked support snapshot', 'mybookaro' ); ?></div>
                    <p class="description bookaro-support__message"><?php esc_html_e( 'Start with the compact masked support snapshot for tickets, comments, and chat. It is the fastest way to share blockers without exposing personal data.', 'mybookaro' ); ?></p>
                    <a class="button button-small" href="<?php echo esc_url( $support_snapshot_url ); ?>">
                        <?php esc_html_e( 'Open masked snapshot', 'mybookaro' ); ?>
                    </a>
                </div>

                <div class="bookaro-support__item">
                    <div class="bookaro-support__label"><?php esc_html_e( 'Support Bundle', 'mybookaro' ); ?></div>
                    <p class="description bookaro-support__message"><?php esc_html_e( 'Use the existing Support Bundle export when the masked snapshot is not enough and support needs the full diagnostic package.', 'mybookaro' ); ?></p>
                    <a class="button button-small" href="<?php echo esc_url( $support_bundle_url ); ?>">
                        <?php esc_html_e( 'Open Support Bundle (if requested)', 'mybookaro' ); ?>
                    </a>
                </div>

                <?php if ( ! empty( $support_url ) ) : ?>
                    <?php
                    $support_label = $is_pro ? __( 'Priority support', 'mybookaro' ) : __( 'Support portal', 'mybookaro' );
                    $support_message = $is_pro
                        ? __( 'Open a ticket after you copy the masked support snapshot and, if needed, attach the Support Bundle for deeper diagnostics.', 'mybookaro' )
                        : __( 'Browse help articles or open a support request after sharing the masked support snapshot from System Status.', 'mybookaro' );
                    $support_action = $is_pro ? __( 'Contact support', 'mybookaro' ) : __( 'Open support', 'mybookaro' );
                    ?>
                    <div class="bookaro-support__item">
                        <div class="bookaro-support__label"><?php echo esc_html( $support_label ); ?></div>
                        <p class="description bookaro-support__message"><?php echo esc_html( $support_message ); ?></p>
                        <a class="button button-small" href="<?php echo esc_url( $support_url ); ?>" target="_blank" rel="noopener">
                            <?php echo esc_html( $support_action ); ?>
                        </a>
                    </div>
                <?php endif; ?>

                <?php if ( ( $integration_mode ?? '' ) === 'generic' ) : ?>
                    <div class="bookaro-support__item">
                        <div class="bookaro-support__label"><?php esc_html_e( 'Lane validation', 'mybookaro' ); ?></div>
                        <p class="description bookaro-support__message"><?php echo esc_html( $generic_validation_summary ?? '' ); ?></p>
                        <a class="button button-small" href="<?php echo esc_url( $generic_validation_url ); ?>">
                            <?php esc_html_e( 'Open validation results', 'mybookaro' ); ?>
                        </a>
                    </div>
                <?php endif; ?>

                <?php if ( ! empty( $support_docs_url ) ) : ?>
                    <div class="bookaro-support__item">
                        <div class="bookaro-support__label"><?php esc_html_e( 'Docs & guides', 'mybookaro' ); ?></div>
                        <p class="description bookaro-support__message"><?php esc_html_e( 'Step-by-step setup guides for each lane, including the Single Business no-listing launch path and the System Status support handoff flow.', 'mybookaro' ); ?></p>
                        <a class="button button-small" href="<?php echo esc_url( $support_docs_url ); ?>" target="_blank" rel="noopener">
                            <?php esc_html_e( 'View docs', 'mybookaro' ); ?>
                        </a>
                    </div>
                <?php endif; ?>
            </div>
            <div class="bookaro-support__faq" style="margin-top:16px;">
                <h3 style="margin:0 0 8px;"><?php esc_html_e( 'FAQ', 'mybookaro' ); ?></h3>
                <ul style="margin:0; padding-left:18px; list-style:disc;">
                    <li><strong><?php esc_html_e( 'Is MyBookaro affiliated with MyListing?', 'mybookaro' ); ?></strong> <?php esc_html_e( 'No. MyBookaro is an independent plugin compatible with MyListing.', 'mybookaro' ); ?></li>
                    <li><strong><?php esc_html_e( 'Is MyBookaro an official MyListing plugin?', 'mybookaro' ); ?></strong> <?php esc_html_e( 'No. MyBookaro is independent and is not affiliated with or endorsed by 27collective.', 'mybookaro' ); ?></li>
                    <li><strong><?php esc_html_e( 'What does Compatible with MyListing mean?', 'mybookaro' ); ?></strong> <?php esc_html_e( 'It means MyBookaro integrates with MyListing-powered sites; compatibility does not imply affiliation or endorsement.', 'mybookaro' ); ?></li>
                </ul>
                <p class="description" style="margin-top:8px;"><?php esc_html_e( 'MyBookaro is an independent plugin compatible with MyListing and is not affiliated with or endorsed by 27collective.', 'mybookaro' ); ?></p>
            </div>
        </div>
    </div>
</div>
