/* Onboarding Wizard Full-Screen Overlay */
.wizard-backdrop,
.wizard-card {
    --bg-card: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-hover: #f1f5f9;
    --primary-color: #ff9f43;
    --primary-color-alpha: rgba(255, 159, 67, 0.1);
    --primary-hover: #e68e3c;
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

.wizard-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    /* backdrop-filter moved to ::before to avoid GPU compositing layer trap */
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--wiz-initial-duration, 0.3s) ease;
}

.wizard-backdrop::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
    pointer-events: none;
}

.wizard-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.wizard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.wizard-card .text-muted {
    color: #4b5563 !important;
    /* Force a dark enough gray for white theme */
}

.wizard-header {
    padding: 32px 32px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.wizard-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.wizard-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.wizard-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--primary-color-alpha);
    color: var(--primary-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.wizard-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.wizard-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Animated Welcome Headline Underline */
.welcome-title {
    position: relative;
    display: table;
    margin-left: auto;
    margin-right: auto;
    width: fit-content;
    margin-top: 0;
    margin-bottom: 12px;
}

.welcome-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 3px;
    background: var(--primary-color);
    width: 0;
    opacity: 0;
    border-radius: 4px;
    animation: underlineWipe var(--wiz-underline-duration, 1s) cubic-bezier(0.65, 0, 0.35, 1) forwards;
    animation-delay: var(--wiz-underline-delay, 0.6s);
}

@keyframes underlineWipe {
    0% {
        width: 0;
        opacity: 0;
    }

    100% {
        width: 100%;
        opacity: 1;
    }
}

.wizard-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 600px) {
    .wizard-body {
        overflow-y: scroll;
        /* always-on scrollbar on mobile */
    }

    .wizard-body::-webkit-scrollbar {
        width: 4px;
    }

    .wizard-body::-webkit-scrollbar-track {
        background: var(--bg-hover, #f1f5f9);
        border-radius: 4px;
    }

    .wizard-body::-webkit-scrollbar-thumb {
        background: var(--primary-color, #ff9f43);
        border-radius: 4px;
        min-height: 40px;
    }
}

/* Steps Transition */
.wizard-step {
    display: none;
    animation: wizardFadeIn 0.3s ease forwards;
}

.wizard-step.active {
    display: block;
}

@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Indicator */
.wizard-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.wizard-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.3s;
}

.wizard-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.wizard-dot.completed {
    background: var(--primary-color-alpha);
}

/* Wizard Specific Elements */
.wizard-value-props {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
}

.wizard-value-props li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.wizard-value-props i {
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.wizard-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.wizard-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.wizard-actions .wizard-btn {
    flex: 1;
}

.wizard-btn-primary {
    background: var(--primary-color);
    color: white;
}

.wizard-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.wizard-btn-primary:active {
    transform: translateY(0);
}

.wizard-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.wizard-btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.wizard-text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
    margin: 16px auto 0;
    display: block;
}

.wizard-text-btn:hover {
    color: var(--text-primary);
}

.btn-label-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.btn-main-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sub-label {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 2px;
}

.wizard-btn-outline-primary .btn-sub-label {
    color: var(--text-primary);
}

.wizard-form-group {
    margin-bottom: 24px;
}

.wizard-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.wizard-form-group .form-input,
.wizard-form-group .form-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color 0.2s;
}

.wizard-form-group .form-input:focus,
.wizard-form-group .form-select:focus {
    border-color: var(--primary-color);
    outline: none;
    background: var(--bg-card);
}

/* Code Snippets in Wizard */
.wizard-code-box {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    position: relative;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.wizard-code-box pre {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    color: var(--text-primary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.wizard-copy-btn,
.wizard-card .btn-copy {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.wizard-copy-btn:hover,
.wizard-card .btn-copy:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* Checklist */
.wizard-checklist {
    margin-top: 24px;
}

.wizard-checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background: var(--bg-hover);
    margin-bottom: 8px;
}

.wizard-checklist-item.done {
    border-left: 3px solid #10b981;
}

.wizard-checklist-item.skipped {
    border-left: 3px solid var(--text-muted);
    opacity: 0.8;
}

.wizard-checklist-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.wizard-checklist-status {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Webhook Cards */
.wizard-webhook-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.wizard-webhook-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-card);
}

.wizard-webhook-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.wizard-webhook-card img {
    height: 32px;
    margin-bottom: 12px;
}

.wizard-webhook-card span {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

/* KPI Target List */
.wizard-kpi-list {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.wizard-kpi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-card);
}

.wizard-kpi-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wizard-kpi-label i {
    color: var(--text-muted);
}

.wizard-kpi-label span {
    font-weight: 500;
    color: var(--text-primary);
}

.wizard-kpi-toggle {
    margin-left: auto;
    margin-right: 16px;
}

.wizard-kpi-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 12px;
    width: 120px;
    transition: opacity 0.2s;
}

.wizard-kpi-input-group.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.wizard-kpi-currency {
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 4px;
}

.wizard-kpi-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 14px;
    outline: none;
    font-variant-numeric: tabular-nums;
}

/* Target and replace old gateway layout entirely */
.gateway-rocket-img {
    display: block;
    margin: 0 auto 24px;
    height: 160px;
    object-fit: contain;
}

.gateway-suite-wrapper {
    background: #1e293b;
    /* Dark theme wrapper */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}



.gateway-suite-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.gateway-suite-header-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.gateway-suite-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gateway-suite-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 4px 0;
}

.gateway-suite-subtitle {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.gateway-suite-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    border: 1px solid var(--primary-color-alpha);
    background: rgba(255, 159, 67, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.gateway-suite-cards {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 32px;
}

.gateway-suite-line {
    position: absolute;
    top: 50%;
    left: 15%;
    right: 15%;
    height: 1px;
    background: rgba(255, 159, 67, 0.3);
    /* Subtle orange tinted line */
    z-index: 0;
    transform: translateY(-50%);
}

.gateway-suite-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    width: 31%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}



.gateway-suite-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 159, 67, 0.05);
    /* very subtle orange */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.gateway-suite-card strong {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
    display: block;
}

.gateway-suite-card span {
    font-size: 13px;
    color: #94a3b8;
}

.gateway-suite-action {
    display: flex;
    justify-content: center;
}

.gateway-suite-action .wizard-btn {
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.gateway-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gateway-skip-btn {
    background: var(--primary-color-alpha);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 8px 20px;
    border-radius: 24px;
}

.gateway-help-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 6px 16px 6px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.gateway-help-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.gateway-help-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-width-btn {
    width: 100%;
}

.wizard-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 500;
}

.wizard-btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.gateway-done-for-you {
    background: var(--primary-color-alpha);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gateway-done-for-you strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.gateway-done-for-you span {
    font-size: 13px;
    color: var(--text-secondary);
}

.gateway-done-for-you a {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gateway-done-for-you a:hover {
    color: var(--primary-color);
}

@media (max-width: 600px) {
    .gateway-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Funnel Modal (Metric Selection, etc.)
   ============================================ */
.funnel-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.funnel-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.funnel-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: wizardFadeUp 0.4s ease-out;
}



.funnel-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.funnel-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.funnel-modal-header p {
    margin: 4px 0 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.funnel-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.funnel-modal-close:hover {
    color: var(--text-primary);
}

.funnel-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.funnel-modal-footer {
    padding: 16px 24px;
    background: var(--bg-card-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.funnel-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.funnel-modal-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.funnel-modal-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.funnel-modal-btn-primary {
    background: var(--primary-color);
    color: white;
}

.funnel-modal-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* ============================================
   Account Selection Modal
   ============================================ */
.account-selection-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.account-selection-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.account-selection-modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: wizardFadeUp 0.4s ease-out;
}



.account-selection-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.account-selection-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.account-selection-header p {
    margin: 8px 0 0 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.account-limit-text {
    margin-top: 12px;
    font-size: 0.8125rem;
    color: var(--primary-color);
    background: var(--primary-alpha);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.account-selection-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}

.account-selection-footer {
    padding: 16px 24px;
    background: var(--bg-card-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-count-container {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.account-selection-confirm-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.account-selection-confirm-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.account-selection-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Webhook phase transitions */
.wizard-webhook-phase {
    animation: fadeIn 0.2s ease;
}

.wizard-webhook-phase.hidden {
    display: none;
}

/* Webhook card grid */
.wizard-webhook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.wizard-webhook-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.wizard-webhook-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-color-alpha);
}

.wizard-webhook-card.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wizard-webhook-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.wizard-webhook-card:hover .wizard-webhook-card-icon {
    color: var(--primary-color);
}

.wizard-webhook-card-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Config panel */
.wizard-webhook-url-section {
    margin: 24px 0;
}

.webhook-url-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.webhook-url-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wizard-webhook-url {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-family: monospace;
    color: #10b981;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.webhook-platform-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* Instructions accordion */
.wizard-webhook-instructions,
.wizard-webhook-payload {
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.wizard-webhook-instructions summary,
.wizard-webhook-payload summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
}

.webhook-instructions-content,
.webhook-payload-content {
    padding: 16px 24px;
    font-size: 13px;
    line-height: 1.6;
}

/* Payload table */
.webhook-payload-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.payload-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 4px 0;
}

.payload-row code {
    min-width: 140px;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
}

.payload-row span {
    color: var(--text-muted);
    font-size: 12px;
}

/* Supplementary section */
.wizard-webhook-supplementary {
    margin-top: 16px;
    border: none;
}

.wizard-webhook-supplementary summary {
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}

.wizard-webhook-grid-supplementary {
    margin-top: 8px;
}

/* Step actions layout */
.wizard-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    gap: 16px;
}

.wizard-step-actions .wizard-btn {
    min-width: 100px;
    height: 44px;
    /* Force consistent height */
}

.wizard-step-actions-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.wizard-step-actions-right .wizard-btn-primary {
    min-width: 180px;
}

/* Webhook Setup Instructions Styling */
.webhook-setup-steps {
    margin: 12px 0;
    padding-left: 20px;
    font-size: 14px;
    color: #334155 !important;
    line-height: 1.6;
}

.webhook-setup-steps li {
    margin-bottom: 8px;
    color: #334155 !important;
}

.webhook-setup-steps strong {
    color: var(--text-primary);
    font-weight: 700;
}

.webhook-setup-steps code {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary-color);
    font-size: 13px;
}

.webhook-setup-steps ul {
    margin: 8px 0;
    padding-left: 20px;
    list-style-type: disc;
}

/* Booking CTA callout */
.wizard-booking-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.wizard-booking-callout i {
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 1px;
}

.wizard-booking-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.wizard-booking-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Config context variant */
.wizard-booking-callout--config {
    background: var(--primary-color-alpha);
    border-color: rgba(255, 167, 31, 0.25);
}

/* Summary context variant */
.wizard-booking-callout--summary {
    background: var(--primary-color-alpha);
    border-color: rgba(255, 167, 31, 0.25);
    margin-top: 8px;
    border-left: 3px solid var(--primary-color);
}

/* ══════════════════════════════════════════════
   STEP 0 ENTRANCE ANIMATION
   Phase 1: Glass glow sweep (0 → 500ms)
   Phase 2: Card height expansion (500 → 950ms)
   ══════════════════════════════════════════════ */

/* Card in step-0-entering state: start collapsed */
.wizard-card.step0-entering {
    animation:
        wizardCardInitial var(--wiz-initial-duration, 0.3s) cubic-bezier(0.16, 1, 0.3, 1) forwards,
        wizardCardExpand var(--wiz-expand-duration, 0.95s) cubic-bezier(0.16, 1, 0.3, 1) var(--wiz-expand-delay, 0.6s) both;
    overflow: hidden;
    transform-origin: center center;
}

@keyframes wizardCardInitial {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes wizardCardExpand {
    0% {
        /* Collapsed: precisely balanced for title + subtitle */
        max-height: 160px;
        box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.3);
    }

    100% {
        max-height: 90vh;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

/* Racing outline overlay — 2 crossing shining dots sweeping across border */
.wizard-card.step0-entering::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    border-radius: 16px;
    padding: 3px;
    /* Stroke width of the racing track */
    background:
        radial-gradient(circle 220px at 50% 50%, #fff 0%, rgba(255, 167, 31, 1) 15%, rgba(255, 167, 31, 0.4) 50%, transparent 100%),
        radial-gradient(circle 220px at 50% 50%, #fff 0%, rgba(255, 167, 31, 1) 15%, rgba(255, 167, 31, 0.4) 50%, transparent 100%);
    background-repeat: no-repeat;
    background-size: 200% 200%;

    /* Using a mask composite to punch a hole through the center, leaving only the padding area */
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;

    animation: wizardRacingOutline var(--wiz-outline-duration, 2s) linear var(--wiz-outline-delay, 0.3s) forwards;
    opacity: 0;
}

@keyframes wizardRacingOutline {
    0% {
        /* Dot 1: Bottom-Left, Dot 2: Top-Right */
        background-position: 100% 0%, 0% 100%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    25% {
        /* Both meet at Top-Left */
        background-position: 100% 100%, 100% 100%;
    }

    50% {
        /* Dot 1: Top-Right, Dot 2: Bottom-Left */
        background-position: 0% 100%, 100% 0%;
        opacity: 1;
    }

    75% {
        /* Both meet at Bottom-Right */
        background-position: 0% 0%, 0% 0%;
    }

    90% {
        opacity: 1;
    }

    100% {
        /* Return to Start */
        background-position: 100% 0%, 0% 100%;
        opacity: 0;
    }
}

/* Card must be position:relative for the ::after overlay to work */
/* (It already is via flex layout — but make it explicit) */
.wizard-card {
    position: relative;
}

/* ── Step 0: Video Skeleton Loader ─────────────────── */
.wizard-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--bg-secondary);
}

.wizard-video-loader {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.wizard-video-loader::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.05) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: videoSkeletonSweep 1.8s infinite;
}

.wizard-video-loader::after {
    content: '';
    position: relative;
    z-index: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--primary-color);
    animation: videoSpinnerRotate 0.9s linear infinite;
}

@keyframes videoSkeletonSweep {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes videoSpinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

.wizard-video-loader.fading {
    opacity: 0;
    pointer-events: none;
}

/* CTA hidden until video loads */
.wizard-step0-actions {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.wizard-step0-actions.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Step 1: Ad Account List ────────────────────────────── */
.wizard-account-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 24px;
    /* subtle bottom fade hinting more content below */
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to bottom, black calc(100% - 32px), transparent 100%);
}

/* Desktop: thin auto-hiding scrollbar is fine */
.wizard-account-list::-webkit-scrollbar {
    width: 4px;
}

.wizard-account-list::-webkit-scrollbar-track {
    background: transparent;
}

.wizard-account-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Mobile: always-on scrollbar so user knows list is scrollable */
@media (max-width: 600px) {
    .wizard-account-list {
        overflow-y: scroll;
        /* forces scrollbar to always reserve space */
        /* Remove fade mask on mobile since scrollbar IS the affordance */
        -webkit-mask-image: none;
        mask-image: none;
        padding-right: 4px;
    }

    .wizard-account-list::-webkit-scrollbar {
        width: 4px;
    }

    .wizard-account-list::-webkit-scrollbar-track {
        background: var(--bg-hover, #f1f5f9);
        border-radius: 4px;
    }

    .wizard-account-list::-webkit-scrollbar-thumb {
        background: var(--primary-color, #ff9f43);
        border-radius: 4px;
        min-height: 40px;
    }
}

/* Ensure groovevideo widget fills the wrapper */
groovevideo-widget {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* ── UTM Warning (Step 6) ──────────────────────────────── */
.utm-warning {
    background: rgba(255, 159, 67, 0.1);
    border-left: 4px solid #ff9f43;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 16px;
}

.utm-warning p {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.5;
}

.utm-warning strong {
    color: #ff9f43;
}